diff --git a/server/static/base.css b/server/static/base.css index 4175424..bd23ac9 100644 --- a/server/static/base.css +++ b/server/static/base.css @@ -1,73 +1,162 @@ :root { - --surface: #fff8f0; - --surface-container-low: #faf3e7; - --surface-container: #f5ede0; - --surface-container-high: #ede3d4; - --surface-container-highest: #e5d9c8; - --surface-container-lowest: #ffffff; - --surface-bright: #fff8f0; - --surface-dim: #e5d9c8; - --primary: #8c4d50; - --primary-hover: #7a3f42; - --primary-container: #fcacaf; - --on-primary: #ffffff; - --on-surface: #363227; - --on-surface-variant: #645f52; - --outline: #b9b1a3; - --outline-variant: #d4cdbe; - --secondary: #b45309; - --secondary-container: #fd8a42; - --on-secondary-container: #682c00; - --error: #ba1a1a; - --error-container: #ffdad6; - --on-error-container: #93000a; - --success-bg: #dcfce7; - --success-text: #166534; - --warning-bg: #fef08a; - --warning-text: #854d0e; - --danger-bg: #fee2e2; - --danger-text: #991b1b; - --info-bg: #f1f5f9; - --info-text: #475569; - --sidebar-width: 17.5rem; - --topnav-height: 3.5rem; - --border-radius-sm: 0.25rem; - --border-radius-md: 0.5rem; - --border-radius-lg: 0.75rem; - --border-radius-full: 9999px; - --font-family: "Inter", system-ui, -apple-system, sans-serif; - --transition: 0.15s ease; + --surface: #fff8f0; + --surface-low: #faf3e7; + --surface-highest: #ede3d4; + --surface-white: #ffffff; + --primary: #8c4d50; + --primary-container: #fcacaf; + --on-primary: #ffffff; + --on-surface: #363227; + --on-surface-dim: #645f52; + --outline: #b9b1a3; + --outline-dim: #d4cdbe; + --error: #ba1a1a; + --error-container: #ffdad6; + --success-bg: #dcfce7; + --success-text: #166534; + --warning-bg: #fef08a; + --warning-text: #854d0e; + --danger-bg: #fee2e2; + --danger-text: #991b1b; + + --space-xs: 0.25rem; + --space-sm: 0.5rem; + --space-md: 1rem; + --space-lg: 1.5rem; + --space-xl: 2rem; + + --sidebar-w: 17.5rem; + --sidebar-w-collapsed: 3.5rem; + --topnav-h: 3.5rem; + + --radius-sm: 0.25rem; + --radius-md: 0.5rem; + --radius-lg: 0.75rem; + --radius-full: 9999px; + + --font: "Inter", system-ui, -apple-system, sans-serif; + --transition: 0.15s ease; } *, *::before, *::after { - box-sizing: border-box; - margin: 0; - padding: 0; + box-sizing: border-box; + margin: 0; + padding: 0; } html, body { - height: 100%; - overflow: hidden; + height: 100%; + overflow: hidden; } body { - font-family: var(--font-family); - font-size: 1rem; - line-height: 1.5; - color: var(--on-surface); - background: var(--surface); - display: flex; + font-family: var(--font); + font-size: 1rem; + line-height: 1.5; + color: var(--on-surface); + background: var(--surface); } -input, select, textarea, button { - font-family: inherit; +h1 { + font-size: 1.25rem; + font-weight: 700; + letter-spacing: -0.01em; +} + +h2 { + font-size: 1rem; + font-weight: 600; + display: flex; + align-items: center; + gap: var(--space-sm); +} + +table { + width: 100%; + border-collapse: collapse; +} + +th, td { + text-align: left; + padding: var(--space-sm) var(--space-sm); + font-size: 0.875rem; + white-space: nowrap; +} + +th { + text-transform: uppercase; + letter-spacing: 0.04em; + font-weight: 600; + color: var(--on-surface-dim); + font-size: 0.75rem; +} + +td { + color: var(--on-surface); + border-bottom: 1px solid var(--outline-dim); +} + +tbody tr { + transition: background var(--transition); + height: 2.5rem; +} + +tbody tr:hover { + background: var(--surface-low); +} + +input, select, textarea { + font: inherit; + font-size: 0.875rem; + height: 2rem; + padding: 0 var(--space-sm); + border: 1px solid var(--outline-dim); + border-radius: var(--radius-sm); + background: var(--surface-white); + color: var(--on-surface); + outline: none; + width: 100%; + transition: border-color var(--transition); +} + +input:focus, select:focus, textarea:focus { + border-color: var(--primary); +} + +input::placeholder, select::placeholder, textarea::placeholder { + color: var(--on-surface-dim); + opacity: 0.6; +} + +textarea { + height: auto; + padding: var(--space-sm); + resize: vertical; +} + +select { + appearance: auto; +} + +button { + font: inherit; + cursor: pointer; +} + +a { + color: inherit; + text-decoration: none; +} + +ul, ol { + list-style: none; } .htmx-request { - opacity: 0.6; - pointer-events: none; + opacity: 0.6; + pointer-events: none; } .hidden { - display: none !important; + display: none !important; } diff --git a/server/static/basket.css b/server/static/basket.css deleted file mode 100644 index 65d4d36..0000000 --- a/server/static/basket.css +++ /dev/null @@ -1,120 +0,0 @@ -/* ========== ORDER SUMMARY ========== */ -#basket-items { - flex: 1; - overflow-y: auto; - padding: 1rem; - display: flex; - flex-direction: column; - gap: 0.5rem; - list-style: none; - - > li { - display: flex; - align-items: flex-start; - justify-content: space-between; - padding-bottom: 0.5rem; - border-bottom: 1px solid var(--outline-variant); - - > div:first-child { - flex: 1; - min-width: 0; - padding-right: 0.5rem; - } - - .name { - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface); - } - - .detail { - font-size: 0.75rem; - color: var(--on-surface-variant); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - .price { - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface); - white-space: nowrap; - } - - .basket-actions .action-btn .material-symbols-outlined { - font-size: 1rem; - } - - .remove { - color: var(--error); - cursor: pointer; - transition: opacity var(--transition); - background: none; - border: none; - margin-left: 0.25rem; - - &:hover { - opacity: 0.8; - } - - .material-symbols-outlined { - font-size: 1rem; - } - } - } -} - -.summary-totals { - padding: 1rem; - border-top: 1px solid var(--outline-variant); - background: var(--surface-bright); - - .total-row { - display: flex; - justify-content: space-between; - align-items: center; - font-size: 0.75rem; - color: var(--on-surface-variant); - - + .total-row { - margin-top: 0.5rem; - } - - &.grand { - font-size: 1rem; - font-weight: 700; - color: var(--on-surface); - padding-top: 0.5rem; - border-top: 1px solid var(--outline-variant); - margin-top: 0.5rem; - } - } - - .btn-finalize { - width: 100%; - height: 2.5rem; - margin-top: 0.5rem; - background: var(--primary); - color: var(--on-primary); - border: none; - border-radius: var(--border-radius-sm); - font-size: 0.75rem; - font-weight: 600; - letter-spacing: 0.02em; - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - cursor: pointer; - transition: opacity var(--transition); - - &:hover { - opacity: 0.9; - } - - .material-symbols-outlined { - font-size: 1.25rem; - } - } -} diff --git a/server/static/card.css b/server/static/card.css deleted file mode 100644 index b93b2a4..0000000 --- a/server/static/card.css +++ /dev/null @@ -1,243 +0,0 @@ -/* ========== CARDS ========== */ -.card { - background: var(--surface-container-lowest); - border: 1px solid var(--outline-variant); - border-radius: var(--border-radius-md); - display: flex; - flex-direction: column; - - > header { - padding: 0.75rem 1rem; - border-bottom: 1px solid var(--outline-variant); - display: flex; - align-items: center; - justify-content: space-between; - background: var(--surface-container-low); - - h2 { - font-size: 1rem; - font-weight: 600; - color: var(--on-surface); - display: flex; - align-items: center; - gap: 0.5rem; - - .material-symbols-outlined { - font-size: 1.25rem; - color: var(--on-surface-variant); - } - } - } - - > div, - > form { - padding: 1rem; - flex: 1; - } - - > footer { - padding: 0.5rem 0.75rem; - border-top: 1px solid var(--outline-variant); - background: var(--surface-container-lowest); - display: flex; - justify-content: space-between; - align-items: center; - font-size: 0.75rem; - color: var(--on-surface-variant); - } -} - -.card > .table-container { - overflow-x: auto; - padding: 0; -} - -/* ========== METRICS GRID ========== */ -.metrics-grid { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 0.75rem; - - > div { - background: var(--surface-container-lowest); - border: 1px solid var(--outline-variant); - border-radius: var(--border-radius-md); - padding: 1rem; - display: flex; - flex-direction: column; - gap: 0.25rem; - - .label { - font-size: 0.75rem; - font-weight: 500; - color: var(--on-surface-variant); - letter-spacing: 0.02em; - display: flex; - align-items: center; - gap: 0.25rem; - - .material-symbols-outlined { - font-size: 1rem; - } - } - - .value { - font-size: 1.75rem; - font-weight: 700; - color: var(--on-surface); - line-height: 1.2; - } - - .change { - font-size: 0.75rem; - font-weight: 600; - display: flex; - align-items: center; - gap: 0.25rem; - - &.positive { - color: var(--success-text); - } - - &.warning { - color: var(--warning-text); - } - - .material-symbols-outlined { - font-size: 1rem; - } - } - } -} - -@media (max-width: 64em) { - .metrics-grid { - grid-template-columns: repeat(2, 1fr); - } -} - -@media (max-width: 48em) { - .metrics-grid { - grid-template-columns: 1fr 1fr; - } -} - -/* ========== SPLIT PANE ========== */ -.split-pane { - display: flex; - flex-direction: column; - gap: 1rem; - flex: 1; - min-height: 0; -} - -.order-left { - flex: 1; - display: flex; - flex-direction: column; - gap: 1rem; - min-width: 0; -} - -.order-aside { - width: 100%; - flex-shrink: 0; - display: flex; - flex-direction: column; -} - -@media (min-width: 64em) { - .split-pane { - flex-direction: row; - } - - .order-aside { - width: 20rem; - } -} - -/* ========== DATA TABLE ========== */ -.data-table { - width: 100%; - border-collapse: collapse; - font-size: 0.75rem; - - thead { - background: var(--surface-container-low); - border-bottom: 1px solid var(--outline-variant); - } - - th { - padding: 0.5rem 0.75rem; - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface-variant); - text-transform: uppercase; - letter-spacing: 0.04em; - text-align: left; - white-space: nowrap; - - &.right { - text-align: right; - } - - &.center { - text-align: center; - } - } - - td { - padding: 0.5rem 0.75rem; - color: var(--on-surface); - white-space: nowrap; - - .truncate { - max-width: 12.5rem; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - display: block; - } - } - - tbody tr { - border-bottom: 1px solid var(--outline-variant); - transition: background var(--transition); - height: 2.5rem; - - &:hover { - background: var(--surface-container-low); - } - - &:nth-child(even) { - background: var(--surface-bright); - - &:hover { - background: var(--surface-container-low); - } - } - } - - .order-id { - font-weight: 700; - color: var(--primary); - text-decoration: none; - } - - .customer { - font-weight: 500; - } - - .text-right { - text-align: right; - } - - .text-center { - text-align: center; - } - - .text-muted { - color: var(--on-surface-variant); - font-weight: 400; - } -} diff --git a/server/static/catalogue.css b/server/static/catalogue.css deleted file mode 100644 index 305bdcb..0000000 --- a/server/static/catalogue.css +++ /dev/null @@ -1,117 +0,0 @@ -/* ========== CATALOGUE GRID ========== */ -#catalogue-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); - gap: 0.5rem; - - > li { - border: 1px solid var(--outline-variant); - border-radius: var(--border-radius-sm); - padding: 0.5rem; - display: flex; - flex-direction: column; - justify-content: space-between; - background: var(--surface-bright); - transition: border-color var(--transition); - list-style: none; - - &:hover { - border-color: var(--outline); - } - - > div:first-child { - display: flex; - align-items: flex-start; - gap: 0.5rem; - } - - .icon { - width: 2rem; - height: 2rem; - border-radius: var(--border-radius-sm); - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - font-size: 1rem; - - &.cake { - background: var(--primary-container); - color: var(--primary); - } - - &.cookie { - background: var(--surface-container-high); - color: var(--on-surface-variant); - } - } - - .name { - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - .price { - font-size: 0.75rem; - color: var(--on-surface-variant); - } - - .actions { - display: flex; - align-items: center; - justify-content: space-between; - margin-top: 0.5rem; - padding-top: 0.5rem; - border-top: 1px solid var(--outline-variant); - - .qty { - width: 1.5rem; - height: 1.5rem; - display: flex; - align-items: center; - justify-content: center; - border: none; - border-radius: var(--border-radius-sm); - cursor: pointer; - font-size: 1rem; - transition: all var(--transition); - - .material-symbols-outlined { - font-size: 1rem; - } - - &.minus { - background: var(--surface-container-low); - color: var(--on-surface-variant); - - &:hover { - background: var(--outline-variant); - color: var(--on-surface); - } - } - - &.plus { - background: var(--surface-container-high); - color: var(--on-surface); - - &:hover { - background: var(--primary); - color: var(--on-primary); - } - } - } - - .value { - font-size: 0.75rem; - font-weight: 500; - color: var(--on-surface); - width: 1.5rem; - text-align: center; - } - } - } -} diff --git a/server/static/component.css b/server/static/component.css deleted file mode 100644 index dc592d9..0000000 --- a/server/static/component.css +++ /dev/null @@ -1,280 +0,0 @@ -/* ========== BUTTONS ========== */ -.btn { - display: inline-flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - padding: 0 1rem; - height: 2.5rem; - border: none; - border-radius: var(--border-radius-sm); - font-size: 0.75rem; - font-weight: 600; - cursor: pointer; - transition: all var(--transition); - text-decoration: none; - - .material-symbols-outlined { - font-size: 1.25rem; - } - - &.primary { - background: var(--primary); - color: var(--on-primary); - - &:hover { - opacity: 0.9; - } - } - - &.outline { - background: transparent; - border: 1px solid var(--outline-variant); - color: var(--on-surface); - - &:hover { - background: var(--surface-container-high); - } - } - - &.sm { - height: 2rem; - padding: 0 0.75rem; - } -} - -/* ========== TABLE ACTIONS ========== */ -.action-btn { - color: var(--on-surface-variant); - cursor: pointer; - transition: color var(--transition); - background: none; - border: none; - - &:hover { - color: var(--primary); - } - - .material-symbols-outlined { - font-size: 1.25rem; - } -} - -/* ========== TAG CHIPS ========== */ -.tag-chip { - display: inline-flex; - align-items: center; - padding: 0.25rem 0.5rem; - border-radius: var(--border-radius-full); - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface-variant); - background: var(--surface-container-high); - border: 1px solid var(--outline-variant); - cursor: pointer; - user-select: none; - transition: all var(--transition); - - &.sm { - font-size: 0.625rem; - padding: 0.125rem 0.375rem; - } - - &:hover, - &.active { - color: var(--primary); - border-color: var(--primary); - background: var(--primary-container); - } -} - -/* ========== PRESET BUTTONS ========== */ -.preset-group { - display: flex; -} - -.preset-btn { - padding: 0.375rem 0.625rem; - font-size: 0.8125rem; - font-weight: 600; - color: var(--on-surface-variant); - text-decoration: none; - display: inline-flex; - align-items: center; - - &:hover, - &.active { - color: var(--primary); - } -} - -/* ========== OVERLAY / DRAWER ========== */ -.overlay { - position: fixed; - inset: 0; - z-index: 1000; - display: none; -} -.overlay.open { - display: flex; - justify-content: flex-end; -} -.overlay-backdrop { - position: absolute; - inset: 0; - background: rgba(0, 0, 0, 0.3); -} -.overlay-panel { - position: relative; - width: 22rem; - max-width: 100vw; - height: 100%; - background: var(--surface); - display: flex; - flex-direction: column; - box-shadow: -0.25rem 0 1.5rem rgba(0, 0, 0, 0.15); - animation: slideIn 0.2s ease; -} -@keyframes slideIn { - from { transform: translateX(100%); } - to { transform: translateX(0); } -} -.overlay-header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 1rem 1.25rem; - border-bottom: 1px solid var(--outline-variant); -} -.overlay-header h2 { - font-size: 1rem; - font-weight: 600; - display: flex; - align-items: center; - gap: 0.5rem; -} -.overlay-header .close-btn { - background: none; - border: none; - cursor: pointer; - color: var(--on-surface-variant); - padding: 0.25rem; - border-radius: var(--border-radius-sm); - display: flex; - align-items: center; - justify-content: center; -} -.overlay-header .close-btn:hover { - background: var(--surface-container-high); - color: var(--on-surface); -} -.overlay-body { - flex: 1; - overflow-y: auto; - padding: 1.25rem; -} -.overlay-footer { - display: flex; - gap: 0.5rem; - justify-content: flex-end; - padding: 1rem 1.25rem; - border-top: 1px solid var(--outline-variant); -} - -/* ========== CARD HEADER ACTIONS ========== */ -.header-actions { - display: flex; - align-items: center; - gap: 0.5rem; -} - -/* ========== TORT BADGE ========== */ -.tort-badge { - display: inline-flex; - align-items: center; - justify-content: center; - width: 1.25rem; - height: 1.25rem; - border-radius: var(--border-radius-full); - background: var(--primary-container); - color: var(--primary); - flex-shrink: 0; - vertical-align: middle; - margin-right: 0.25rem; -} -.tort-badge .material-symbols-outlined { - font-size: 0.75rem; -} - -/* ========== SEARCH INPUT UTILITY ========== */ -.search-wrapper { position: relative; width: 11.25rem; } -.search-icon { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); font-size: 1rem; color: var(--on-surface-variant); pointer-events: none; } -.search-input { height: 1.75rem; padding-left: 1.75rem; padding-right: 0.5rem; font-size: 0.75rem; border: 1px solid var(--outline-variant); border-radius: var(--border-radius-sm); background: var(--surface-container-lowest); color: var(--on-surface); outline: none; width: 100%; } - -/* ========== STATUS SELECT ========== */ -.status-select { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.375rem; border: 1px solid var(--outline-variant); border-radius: var(--border-radius-sm); background: var(--surface); color: var(--on-surface); cursor: pointer; } - -/* ========== FONT UTILITIES ========== */ -.font-bold { font-weight: 700; } - -/* ========== CAKE BREAKDOWN LIST ========== */ -.breakdown-list { list-style: none; padding: 0; margin: 0; } -.breakdown-item { display: flex; justify-content: space-between; padding: 0.375rem 1rem; margin: 0 -1rem; border-bottom: 1px solid var(--outline-variant); } -.breakdown-amount { font-weight: 600; } -.breakdown-empty { color: var(--on-surface-variant); font-size: 0.75rem; } - -/* ========== FILTER BAR (catalogue/cakes page) ========== */ -.filter-bar { padding: 0.5rem 1rem; border-bottom: 1px solid var(--outline-variant); display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; } -.filter-bar .filter-label { font-size: 0.75rem; font-weight: 600; color: var(--on-surface-variant); align-self: center; margin-right: 0.25rem; } - -/* ========== CATALOGUE TAG ROW ========== */ -.tag-row { padding: 0.5rem 1rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem; } - -/* ========== CATALOGUE SCROLL ========== */ -.catalogue-scroll { overflow-y: auto; padding: 1rem; } - -/* ========== BASKET ACTIONS ========== */ -.basket-actions { display: flex; flex-direction: column; gap: 0.125rem; } - -/* ========== TAG GROUP ========== */ -.tag-group { margin-top: 0.25rem; display: flex; flex-wrap: wrap; gap: 0.125rem; } - -/* ========== OVERLAY FORM ========== */ -.overlay-form { display: flex; flex-direction: column; gap: 0.75rem; } - -/* ========== TAG CONTAINER ========== */ -.tag-grid { display: flex; flex-wrap: wrap; gap: 0.25rem; } - -/* ========== FONT UTILITIES ========== */ -.font-medium { font-weight: 500; } - -/* ========== FLEX UTILITIES ========== */ -.grow { flex: 1; } - -.icon.sm { width: 1.75rem; height: 1.75rem; } -.icon.sm .material-symbols-outlined { font-size: 1rem; } - -/* ========== RESULTS PANE ========== */ -#results-pane { display: flex; flex-direction: column; gap: 1rem; } - -/* ========== CONFIRMATION ========== */ -section.confirmation { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - flex: 1; - gap: 0.5rem; - text-align: center; - - .success-icon { - font-size: 3rem; - color: var(--success-text); - } - - h2 { - font-size: 1.25rem; - font-weight: 600; - color: var(--on-surface); - } -} diff --git a/server/static/components.css b/server/static/components.css new file mode 100644 index 0000000..e3b20ec --- /dev/null +++ b/server/static/components.css @@ -0,0 +1,870 @@ +/* ===== Material Icons sizing ===== */ +.material-symbols-outlined { + font-size: 1.25rem; +} + +/* ===== Card ===== */ +.card { + background: var(--surface-white); + border: 1px solid var(--outline-dim); + border-radius: var(--radius-md); + display: flex; + flex-direction: column; +} + +.card > header { + padding: var(--space-sm) var(--space-md); + border-bottom: 1px solid var(--outline-dim); + display: flex; + align-items: center; + justify-content: space-between; + background: var(--surface-low); + gap: var(--space-sm); +} + +.card > header h2 .material-symbols-outlined { + color: var(--on-surface-dim); +} + +.card > div, .card > form { + padding: var(--space-md); + flex: 1; +} + +.card > footer { + padding: var(--space-sm) var(--space-md); + border-top: 1px solid var(--outline-dim); + display: flex; + justify-content: flex-end; + align-items: center; + gap: var(--space-sm); + flex-shrink: 0; +} + +.card > table { + border-collapse: separate; + border-spacing: 0; +} + +.card > table th:first-child { padding-left: var(--space-md); } +.card > table td:first-child { padding-left: var(--space-md); } +.card > table th:last-child { padding-right: var(--space-md); } +.card > table td:last-child { padding-right: var(--space-md); } + +.card-sm { + max-width: 30rem; +} + +/* ===== Button ===== */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: var(--space-sm); + padding: 0 var(--space-md); + height: 2.5rem; + border: none; + border-radius: var(--radius-sm); + font-size: 0.875rem; + font-weight: 600; + cursor: pointer; + transition: all var(--transition); + text-decoration: none; + white-space: nowrap; +} + +.btn-primary { + background: var(--primary); + color: var(--on-primary); +} + +.btn-primary:hover { + opacity: 0.9; +} + +.btn-outline { + background: transparent; + border: 1px solid var(--outline-dim); + color: var(--on-surface); +} + +.btn-outline:hover { + background: var(--surface-highest); +} + +.btn-sm { + height: 2rem; + padding: 0 var(--space-sm); + font-size: 0.75rem; +} + +.btn-icon { + color: var(--on-surface-dim); + cursor: pointer; + transition: color var(--transition); + background: none; + border: none; + padding: var(--space-xs); + border-radius: var(--radius-sm); + display: inline-flex; + align-items: center; + justify-content: center; +} + +.btn-icon:hover { + color: var(--primary); + background: var(--surface-low); +} + +.btn-icon .material-symbols-outlined { + font-size: 1.25rem; +} + +.remove { + color: var(--error); + cursor: pointer; + transition: opacity var(--transition); + background: none; + border: none; + display: inline-flex; + align-items: center; + justify-content: center; + padding: var(--space-xs); + border-radius: var(--radius-sm); +} + +.remove:hover { + opacity: 0.8; + background: var(--error-container); +} + +.remove .material-symbols-outlined { + font-size: 1rem; +} + +/* ===== Tag chip ===== */ +.tag-chip { + display: inline-flex; + align-items: center; + padding: var(--space-xs) var(--space-sm); + border-radius: var(--radius-full); + font-size: 0.75rem; + font-weight: 600; + color: var(--on-surface-dim); + background: var(--surface-highest); + border: 1px solid var(--outline-dim); + cursor: pointer; + user-select: none; + transition: all var(--transition); + white-space: nowrap; +} + +.tag-chip.sm { + font-size: 0.625rem; + padding: 0.125rem 0.375rem; +} + +.tag-chip:hover, .tag-chip.active { + color: var(--primary); + border-color: var(--primary); + background: var(--primary-container); +} + +.tag-chip input[type="checkbox"] { + display: none; +} + +.tag-grid { + display: flex; + flex-wrap: wrap; + gap: var(--space-xs); +} + +.tag-row { + padding: var(--space-sm) var(--space-md) 0; + display: flex; + flex-wrap: wrap; + gap: var(--space-xs); +} + +.tag-group { + margin-top: var(--space-xs); + display: flex; + flex-wrap: wrap; + gap: 0.125rem; +} + +/* ===== Toggle group ===== */ +.toggle-group { + display: flex; + height: 2rem; + border-radius: var(--radius-sm); + border: 1px solid var(--outline-dim); + overflow: hidden; +} + +.toggle-btn { + flex: 1; + border: none; + background: var(--surface-white); + color: var(--on-surface-dim); + font-size: 0.875rem; + font-weight: 600; + cursor: pointer; + transition: all var(--transition); + padding: 0 var(--space-sm); +} + +.toggle-btn:not(:last-child) { + border-right: 1px solid var(--outline-dim); +} + +.toggle-btn.active { + background: var(--primary); + color: var(--on-primary); +} + +.toggle-btn:not(.active):hover { + background: var(--surface-highest); +} + +/* ===== Data table ===== */ +.data-table tbody tr:nth-child(even) { + background: var(--surface); +} + +.data-table tbody tr:nth-child(even):hover { + background: var(--surface-low); +} + +.data-table .order-id { + font-weight: 700; + color: var(--primary); + text-decoration: none; +} + +/* ===== Search ===== */ +.search { + position: relative; +} + +.search .material-symbols-outlined { + position: absolute; + left: var(--space-sm); + top: 50%; + transform: translateY(-50%); + font-size: 1rem; + color: var(--on-surface-dim); + pointer-events: none; +} + +.search input { + padding-left: 1.75rem; + font-size: 0.875rem; +} + +/* ===== Metrics grid ===== */ +.metrics-grid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: var(--space-sm); +} + +.metrics-grid > div { + background: var(--surface-white); + border: 1px solid var(--outline-dim); + border-radius: var(--radius-md); + padding: var(--space-md); + display: flex; + flex-direction: column; + gap: var(--space-xs); +} + +.metrics-grid .label { + font-size: 0.75rem; + font-weight: 500; + color: var(--on-surface-dim); + letter-spacing: 0.02em; + display: flex; + align-items: center; + gap: var(--space-xs); +} + +.metrics-grid .label .material-symbols-outlined { + font-size: 1rem; +} + +.metrics-grid .value { + font-size: 1.75rem; + font-weight: 700; + line-height: 1.2; +} + +.metrics-grid .change { + font-size: 0.75rem; + font-weight: 600; +} + +/* ===== Split pane (order form) ===== */ +.split-pane { + display: flex; + flex-direction: column; + gap: var(--space-md); + flex: 1; + min-height: 0; +} + +.order-left { + flex: 1; + display: flex; + flex-direction: column; + gap: var(--space-md); + min-width: 0; +} + +.order-aside { + width: 100%; + flex-shrink: 0; + display: flex; + flex-direction: column; +} + +.order-aside .card { + flex: 1; + display: flex; + flex-direction: column; +} + +#basket-items { + flex: 1; + overflow-y: auto; + padding: var(--space-md); + display: flex; + flex-direction: column; + gap: var(--space-sm); +} + +#basket-items > li { + display: flex; + align-items: flex-start; + gap: var(--space-sm); + padding-bottom: var(--space-sm); + border-bottom: 1px solid var(--outline-dim); +} + +.basket-item-body { + flex: 1; + min-width: 0; +} + +.basket-item-body .name { + font-size: 0.875rem; + font-weight: 600; +} + +.basket-item-body .detail { + font-size: 0.75rem; + color: var(--on-surface-dim); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.basket-item-tags { + margin-top: var(--space-xs); + display: flex; + flex-wrap: wrap; + gap: 0.125rem; +} + +#basket-items .price { + font-size: 0.875rem; + font-weight: 600; + white-space: nowrap; + flex-shrink: 0; +} + +.basket-item-actions { + display: flex; + flex-direction: column; + gap: 0.125rem; + flex-shrink: 0; +} + +.basket-item-actions .btn-icon .material-symbols-outlined, +.basket-item-actions .remove .material-symbols-outlined { + font-size: 1rem; +} + +.summary-totals { + padding: var(--space-md); + border-top: 1px solid var(--outline-dim); + background: var(--surface); + flex-shrink: 0; +} + +.total-row { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 0.875rem; + color: var(--on-surface-dim); +} + +.total-row + .total-row { + margin-top: var(--space-sm); +} + +.total-row.grand { + font-size: 1rem; + font-weight: 700; + color: var(--on-surface); + padding-top: var(--space-sm); + border-top: 1px solid var(--outline-dim); + margin-top: var(--space-sm); +} + +.btn-finalize { + width: 100%; + height: 2.5rem; + margin-top: var(--space-sm); + background: var(--primary); + color: var(--on-primary); + border: none; + border-radius: var(--radius-sm); + font-size: 0.875rem; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; + gap: var(--space-sm); + cursor: pointer; + transition: opacity var(--transition); +} + +.btn-finalize:hover { + opacity: 0.9; +} + +@media (min-width: 64em) { + .split-pane { + flex-direction: row; + } + + .order-aside { + width: 20rem; + } +} + +/* ===== Catalogue grid ===== */ +.catalogue-search { + display: flex; + align-items: center; + gap: var(--space-sm); +} + +.catalogue-scroll { + overflow-y: auto; + padding: var(--space-md); +} + +#catalogue-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); + gap: var(--space-sm); +} + +#catalogue-grid > li { + border: 1px solid var(--outline-dim); + border-radius: var(--radius-sm); + padding: var(--space-sm); + display: flex; + flex-direction: column; + justify-content: space-between; + background: var(--surface); + transition: border-color var(--transition); +} + +#catalogue-grid > li:hover { + border-color: var(--outline); +} + +#catalogue-grid > li > div:first-child { + display: flex; + align-items: flex-start; + gap: var(--space-sm); +} + +#catalogue-grid .icon { + width: 2rem; + height: 2rem; + border-radius: var(--radius-sm); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + font-size: 1rem; +} + +#catalogue-grid .icon.cake { + background: var(--primary-container); + color: var(--primary); +} + +#catalogue-grid .name { + font-size: 0.75rem; + font-weight: 600; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#catalogue-grid .price { + font-size: 0.75rem; + color: var(--on-surface-dim); +} + +#catalogue-grid .actions { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: var(--space-sm); + padding-top: var(--space-sm); + border-top: 1px solid var(--outline-dim); +} + +#catalogue-grid .qty { + width: 1.5rem; + height: 1.5rem; + display: flex; + align-items: center; + justify-content: center; + border: none; + border-radius: var(--radius-sm); + cursor: pointer; + font-size: 1rem; + transition: all var(--transition); +} + +#catalogue-grid .qty .material-symbols-outlined { + font-size: 1rem; +} + +#catalogue-grid .qty.minus { + background: var(--surface-low); + color: var(--on-surface-dim); +} + +#catalogue-grid .qty.minus:hover { + background: var(--outline-dim); + color: var(--on-surface); +} + +#catalogue-grid .qty.plus { + background: var(--surface-highest); + color: var(--on-surface); +} + +#catalogue-grid .qty.plus:hover { + background: var(--primary); + color: var(--on-primary); +} + +#catalogue-grid .value { + font-size: 0.75rem; + font-weight: 500; + width: 1.5rem; + text-align: center; +} + +/* ===== Overlay / Drawer ===== */ +.overlay { + position: fixed; + inset: 0; + z-index: 1000; + display: none; +} + +.overlay.open { + display: flex; + justify-content: flex-end; +} + +.overlay-backdrop { + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.3); +} + +.overlay-panel { + position: relative; + width: 22rem; + max-width: 100vw; + height: 100%; + background: var(--surface); + display: flex; + flex-direction: column; + box-shadow: -0.25rem 0 1.5rem rgba(0, 0, 0, 0.15); + animation: slideIn 0.2s ease; +} + +@keyframes slideIn { + from { transform: translateX(100%); } + to { transform: translateX(0); } +} + +.overlay-panel > header { + display: flex; + align-items: center; + justify-content: space-between; + padding: var(--space-md) var(--space-lg); + border-bottom: 1px solid var(--outline-dim); +} + +.overlay-panel > header h2 { + font-size: 1rem; + font-weight: 600; + display: flex; + align-items: center; + gap: var(--space-sm); +} + +.overlay-panel > header .close-btn { + background: none; + border: none; + cursor: pointer; + color: var(--on-surface-dim); + padding: var(--space-xs); + border-radius: var(--radius-sm); + display: flex; + align-items: center; + justify-content: center; +} + +.overlay-panel > header .close-btn:hover { + background: var(--surface-highest); + color: var(--on-surface); +} + +.overlay-body { + flex: 1; + overflow-y: auto; + padding: var(--space-lg); +} + +.overlay-body > div { + display: flex; + flex-direction: column; + gap: var(--space-sm); +} + +.overlay-body label { + font-size: 0.75rem; + font-weight: 600; + color: var(--on-surface-dim); + letter-spacing: 0.02em; +} + +.overlay-panel > footer { + display: flex; + gap: var(--space-sm); + justify-content: flex-end; + padding: var(--space-md) var(--space-lg); + border-top: 1px solid var(--outline-dim); +} + +/* ===== Button center (special cakes card) ===== */ +.button-center { + padding: var(--space-md); + text-align: center; +} + +/* ===== Catalogue card ===== */ +.card-catalogue { + flex: 1; + min-height: 12.5rem; +} + +/* ===== Form grid ===== */ +.form-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: var(--space-sm); +} + +@media (max-width: 64em) { + .form-grid { + grid-template-columns: repeat(2, 1fr); + } +} + +@media (max-width: 48em) { + .form-grid { + grid-template-columns: 1fr; + } +} + +label { + font-size: 0.75rem; + font-weight: 600; + color: var(--on-surface-dim); + letter-spacing: 0.02em; +} + +label + input, +label + select, +label + textarea, +label + div:not(.tag-grid) { + margin-top: var(--space-xs); +} + +input + label, +select + label, +textarea + label { + margin-top: var(--space-sm); +} + +.form-grid label { + display: block; + font-size: 0.75rem; + font-weight: 600; + color: var(--on-surface-dim); + letter-spacing: 0.02em; + margin-bottom: var(--space-xs); +} + +.form-grid > div { + display: flex; + flex-direction: column; +} + +.col-span-2 { + grid-column: span 2; +} + +/* ===== Horizontal group ===== */ +.horizontal-group { + display: flex; + gap: var(--space-sm); + align-items: center; + flex-wrap: wrap; +} + +/* ===== Form actions ===== */ +.form-actions { + display: flex; + justify-content: flex-end; + gap: var(--space-sm); + padding-top: var(--space-sm); +} + +/* ===== Preset group (date filter) ===== */ +.preset-group { + display: flex; +} + +.preset-btn { + padding: 0.375rem 0.625rem; + font-size: 0.875rem; + font-weight: 600; + color: var(--on-surface-dim); + text-decoration: none; + display: inline-flex; + align-items: center; +} + +.preset-btn:hover, .preset-btn.active { + color: var(--primary); +} + +/* ===== Filter bar ===== */ +.filter-bar { + padding: var(--space-sm) var(--space-md); + border-bottom: 1px solid var(--outline-dim); + display: flex; + flex-wrap: wrap; + gap: var(--space-xs); + align-items: center; +} + +.filter-bar .filter-label { + font-size: 0.75rem; + font-weight: 600; + color: var(--on-surface-dim); +} + +/* ===== Header actions ===== */ +.header-actions { + display: flex; + align-items: center; + gap: var(--space-sm); +} + +/* ===== Confirmation ===== */ +.confirmation { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + flex: 1; + gap: var(--space-sm); + text-align: center; +} + +.confirmation .success-icon { + font-size: 3rem; + color: var(--success-text); +} + +/* ===== Breakdown list ===== */ +.breakdown-list { + list-style: none; +} + +.breakdown-item { + display: flex; + justify-content: space-between; + padding: 0.375rem var(--space-md); + margin: 0 calc(-1 * var(--space-md)); + border-bottom: 1px solid var(--outline-dim); +} + +.breakdown-amount { + font-weight: 600; +} + +.breakdown-empty { + color: var(--on-surface-dim); + font-size: 0.875rem; +} + +/* ===== Icon ===== */ +.icon { + width: 2rem; + height: 2rem; + border-radius: var(--radius-sm); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.icon.cake { + background: var(--primary-container); + color: var(--primary); +} + +/* ===== Text utilities ===== */ +.text-right { text-align: right; } +.text-center { text-align: center; } +.text-muted { color: var(--on-surface-dim); font-weight: 400; } +.font-bold { font-weight: 700; } +.font-medium { font-weight: 500; } +.grow { flex: 1; } + +/* ===== Empty state ===== */ +.empty-state { + text-align: center; + padding: var(--space-md) 0; + color: var(--on-surface-dim); +} diff --git a/server/static/form.css b/server/static/form.css deleted file mode 100644 index 69581d7..0000000 --- a/server/static/form.css +++ /dev/null @@ -1,126 +0,0 @@ -/* ========== FORM ========== */ -.form-grid { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 0.75rem; -} - -@media (max-width: 64em) { - .form-grid { - grid-template-columns: repeat(2, 1fr); - } -} - -@media (max-width: 48em) { - .form-grid { - grid-template-columns: 1fr; - } -} - -.form-group, -.horizontal-group { - display: flex; - gap: 0.25rem; - &.form-group { - flex-direction: column; - } - &.horizontal-group { - align-items: center; - } -} - -form { - & label { - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface-variant); - letter-spacing: 0.02em; - } - & input, - & select, - & textarea { - height: 2rem; - padding: 0 0.5rem; - border: 1px solid var(--outline-variant); - border-radius: var(--border-radius-sm); - background: var(--surface-container-lowest); - font-size: 0.75rem; - color: var(--on-surface); - outline: none; - transition: border-color var(--transition); - width: 100%; - - &:focus { - border-color: var(--primary); - } - - &::placeholder { - color: var(--on-surface-variant); - opacity: 0.6; - } - - &:is(textarea) { - height: auto; - padding: 0.5rem; - resize: vertical; - } - - &:is(select) { - appearance: auto; - } - } -} - -.form-card { - max-width: 30rem; - - .card > div { - display: flex; - flex-direction: column; - gap: 1rem; - } -} - -/* ========== TOGGLE GROUP ========== */ -.toggle-group { - display: flex; - height: 2rem; - border-radius: var(--border-radius-sm); - border: 1px solid var(--outline-variant); - overflow: hidden; -} - -.toggle-btn { - flex: 1; - border: none; - background: var(--surface-container-lowest); - color: var(--on-surface-variant); - font-size: 0.75rem; - font-weight: 600; - cursor: pointer; - transition: all var(--transition); - padding: 0 0.5rem; -} - -.toggle-btn:not(:last-child) { - border-right: 1px solid var(--outline-variant); -} - -.toggle-btn.active { - background: var(--primary); - color: var(--on-primary); -} - -.toggle-btn:not(.active):hover { - background: var(--surface-container-high); -} - -.form-actions { - display: flex; - justify-content: flex-end; - gap: 0.5rem; - padding-top: 0.5rem; - border-top: 1px solid var(--outline-variant); - margin-top: 0.5rem; -} - diff --git a/server/static/layout.css b/server/static/layout.css index 027d0fc..df8d3ac 100644 --- a/server/static/layout.css +++ b/server/static/layout.css @@ -1,361 +1,239 @@ -/* ========== SIDEBAR ========== */ -aside.sidebar { - position: fixed; - left: 0; - top: 0; - bottom: 0; - width: var(--sidebar-width); - background: var(--surface-container-lowest); - border-right: 1px solid var(--outline-variant); - display: flex; - flex-direction: column; - padding: 1rem; - z-index: 40; - transition: width 0.2s ease, padding 0.2s ease; - - .brand { - display: flex; - align-items: center; - gap: 0.5rem; - margin-bottom: 1.5rem; - padding: 0 0.5rem; - - .collapse-btn { - background: none; - border: none; - cursor: pointer; - color: var(--on-surface-variant); - padding: 0.25rem; - border-radius: var(--border-radius-sm); - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - - &:hover { - background: var(--surface-container-high); - color: var(--on-surface); - } - - .material-symbols-outlined { - font-size: 1.25rem; - } - } - - .brand-text { - overflow: hidden; - white-space: nowrap; - - h1 { - font-size: 1.25rem; - font-weight: 700; - color: var(--primary); - letter-spacing: -0.01em; - line-height: 1.3; - } - - p { - font-size: 0.75rem; - color: var(--on-surface-variant); - margin-top: 0.25rem; - } - } - } - - .cta { - width: 100%; - height: 2.5rem; - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - background: var(--primary); - color: var(--on-primary); - border: none; - border-radius: var(--border-radius-md); - font-size: 0.75rem; - font-weight: 600; - letter-spacing: 0.02em; - cursor: pointer; - text-decoration: none; - margin-bottom: 1.5rem; - transition: opacity var(--transition); - - &:hover { - opacity: 0.9; - } - - .material-symbols-outlined { - font-size: 1.25rem; - } - } - - nav { - flex: 1; - display: flex; - flex-direction: column; - gap: 0.25rem; - - a.link { - display: flex; - align-items: center; - gap: 0.75rem; - padding: 0.75rem 1rem; - border-radius: var(--border-radius-md); - font-size: 0.75rem; - font-weight: 500; - text-decoration: none; - color: var(--on-surface-variant); - transition: all var(--transition); - cursor: pointer; - - &:hover { - background: var(--surface-container-low); - color: var(--on-surface); - } - - &.active { - background: var(--primary-container); - color: var(--primary); - font-weight: 700; - } - - .material-symbols-outlined { - font-size: 1.25rem; - } - } - } - - footer { - margin-top: auto; - padding-top: 1rem; - border-top: 1px solid var(--outline-variant); - - .user { - display: flex; - align-items: center; - gap: 0.75rem; - padding: 0.5rem; - margin-top: 0.75rem; - - .avatar { - width: 2rem; - height: 2rem; - border-radius: 50%; - background: var(--surface-container-high); - display: flex; - align-items: center; - justify-content: center; - color: var(--on-surface); - font-size: 1rem; - font-weight: 700; - flex-shrink: 0; - } - - .info { - display: flex; - flex-direction: column; - - .name { - font-size: 0.75rem; - font-weight: 600; - color: var(--on-surface); - } - - .status { - font-size: 0.75rem; - color: var(--on-surface-variant); - } - } - } - } +body { + display: grid; + grid-template-columns: var(--sidebar-w) 1fr; + grid-template-rows: var(--topnav-h) 1fr; + grid-template-areas: + "sidebar topnav" + "sidebar main"; + height: 100dvh; } -/* ---------- COLLAPSED ---------- */ -body.sidebar-collapsed aside.sidebar { - width: 3.5rem; - padding: 0.5rem; - - .brand .brand-text { - display: none; - } - - .cta { - padding: 0; - width: 2.5rem; - height: 2.5rem; - margin-left: auto; - margin-right: auto; - border-radius: 50%; - - span:not(.material-symbols-outlined) { - display: none; - } - } - - nav a.link { - justify-content: center; - padding: 0.75rem 0.5rem; - - span:not(.material-symbols-outlined) { - display: none; - } - } - - footer .user .info { - display: none; - } +body.sidebar-collapsed { + grid-template-columns: var(--sidebar-w-collapsed) 1fr; } -body.sidebar-collapsed main { - margin-left: 3.5rem; - width: calc(100% - 3.5rem); +/* ===== Sidebar ===== */ +aside { + grid-area: sidebar; + background: var(--surface-white); + border-right: 1px solid var(--outline-dim); + display: flex; + flex-direction: column; + padding: var(--space-md); + gap: var(--space-sm); + overflow: hidden; + z-index: 40; + transition: width 0.2s ease, padding 0.2s ease; } -/* ========== MAIN LAYOUT ========== */ +aside > .collapse-btn { + background: none; + border: none; + cursor: pointer; + color: var(--on-surface-dim); + padding: var(--space-xs); + border-radius: var(--radius-sm); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + width: 2rem; + height: 2rem; +} + +aside > .collapse-btn:hover { + background: var(--surface-highest); + color: var(--on-surface); +} + +aside > .cta { + width: 100%; + height: 2.5rem; + display: flex; + align-items: center; + justify-content: center; + gap: var(--space-sm); + background: var(--primary); + color: var(--on-primary); + border: none; + border-radius: var(--radius-md); + font-size: 0.875rem; + font-weight: 600; + cursor: pointer; + text-decoration: none; + transition: opacity var(--transition); +} + +aside > .cta:hover { + opacity: 0.9; +} + +aside > nav { + flex: 1; + display: flex; + flex-direction: column; + gap: var(--space-xs); +} + +aside > nav > a { + display: flex; + align-items: center; + gap: var(--space-sm); + padding: var(--space-sm) var(--space-md); + border-radius: var(--radius-md); + font-size: 0.875rem; + font-weight: 500; + text-decoration: none; + color: var(--on-surface-dim); + transition: all var(--transition); +} + +aside > nav > a:hover { + background: var(--surface-low); + color: var(--on-surface); +} + +aside > nav > a.active { + background: var(--primary-container); + color: var(--primary); + font-weight: 700; +} + +body.sidebar-collapsed aside { + width: var(--sidebar-w-collapsed); + padding: var(--space-xs); + align-items: center; +} + +body.sidebar-collapsed aside > .cta { + width: 2.5rem; + height: 2.5rem; + padding: 0; + border-radius: 50%; +} + +body.sidebar-collapsed aside > .cta span:not(.material-symbols-outlined) { + display: none; +} + +body.sidebar-collapsed aside > nav > a { + justify-content: center; + padding: var(--space-sm); +} + +body.sidebar-collapsed aside > nav > a span:not(.material-symbols-outlined) { + display: none; +} + +/* ===== Topnav ===== */ +.topnav { + grid-area: topnav; + border-bottom: 1px solid var(--outline-dim); + background: var(--surface); + display: flex; + align-items: center; + gap: var(--space-lg); + padding: 0 var(--space-lg); + flex-shrink: 0; + position: sticky; + top: 0; + z-index: 30; +} + +.topnav > h1 { + margin-right: auto; +} + +.topnav > .search { + position: relative; + width: 15rem; +} + +.topnav > .search input { + height: 2rem; + padding-left: 2rem; + font-size: 0.875rem; +} + +.topnav > .search .material-symbols-outlined { + position: absolute; + left: var(--space-sm); + top: 50%; + transform: translateY(-50%); + font-size: 1.25rem; + color: var(--on-surface-dim); + pointer-events: none; +} + +/* ===== Main ===== */ main { - margin-left: var(--sidebar-width); - width: calc(100% - var(--sidebar-width)); - display: flex; - flex-direction: column; - height: 100dvh; - transition: margin-left 0.2s ease, width 0.2s ease; + grid-area: main; + overflow-y: auto; } -/* ========== TOP NAVBAR ========== */ -header.topnav { - height: var(--topnav-height); - border-bottom: 1px solid var(--outline-variant); - background: var(--surface); - display: flex; - align-items: center; - gap: 1.5rem; - padding: 0 1.5rem; - flex-shrink: 0; - position: sticky; - top: 0; - z-index: 30; - - h1 { - font-size: 1.25rem; - font-weight: 700; - color: var(--on-surface); - letter-spacing: -0.01em; - white-space: nowrap; - margin-right: auto; - } - - search { - position: relative; - width: 15rem; - - .material-symbols-outlined { - position: absolute; - left: 0.5rem; - top: 50%; - transform: translateY(-50%); - font-size: 1.25rem; - color: var(--on-surface-variant); - pointer-events: none; - } - - input { - width: 100%; - height: 2rem; - padding: 0 0.5rem 0 2rem; - border: 1px solid var(--outline-variant); - border-radius: var(--border-radius-sm); - background: var(--surface-container-lowest); - font-size: 0.75rem; - color: var(--on-surface); - outline: none; - transition: border-color var(--transition); - - &:focus { - border-color: var(--primary); - } - - &::placeholder { - color: var(--on-surface-variant); - opacity: 0.6; - } - } - } -} - -/* ========== MAIN CONTENT ========== */ .main-content { - flex: 1; - overflow-y: auto; - padding: 1rem; - display: flex; - flex-direction: column; - gap: 1rem; + padding: var(--space-md); + display: flex; + flex-direction: column; + gap: var(--space-md); + min-height: 0; + flex: 1; } -/* ========== RESPONSIVE ========== */ +/* ===== Responsive ===== */ @media (max-width: 64em) { - header.topnav search { - width: 10rem; - } + .topnav > .search { + width: 10rem; + } } @media (max-width: 48em) { - body:not(.sidebar-collapsed) aside.sidebar { - width: 3.5rem; - padding: 0.5rem; + aside { + width: var(--sidebar-w-collapsed); + padding: var(--space-xs); + align-items: center; + } - .brand .brand-text, - .cta span:not(.material-symbols-outlined), - nav a.link span:not(.material-symbols-outlined), - .user .info { - display: none; - } + aside > .cta { + width: 2.5rem; + height: 2.5rem; + padding: 0; + border-radius: 50%; + } - .cta { - padding: 0; - width: 2.5rem; - height: 2.5rem; - margin: 0 auto 1rem; - border-radius: 50%; - } + aside > .cta span:not(.material-symbols-outlined) { + display: none; + } - nav a.link { - justify-content: center; - padding: 0.75rem 0.5rem; - } + aside > nav > a { + justify-content: center; + padding: var(--space-sm); + } - .user { - justify-content: center; - } - } + aside > nav > a span:not(.material-symbols-outlined) { + display: none; + } - body.sidebar-collapsed aside.sidebar { - width: 0; - padding: 0; - overflow: hidden; - border-right: none; - } + body.sidebar-collapsed aside { + width: 0; + padding: 0; + overflow: hidden; + border-right: none; + } - body.sidebar-collapsed main { - margin-left: 0; - width: 100%; - } + body.sidebar-collapsed { + grid-template-columns: 0 1fr; + } - main { - margin-left: 3.5rem; - width: calc(100% - 3.5rem); - } + .topnav { + padding: 0 var(--space-sm); + } - header.topnav { - padding: 0 0.75rem; + .topnav > .search { + display: none; + } - search { - display: none; - } - } - - .main-content { - padding: 0.5rem; - } + .main-content { + padding: var(--space-sm); + } } diff --git a/server/static/order.js b/server/static/order.js index c4fbe2a..67c2b56 100644 --- a/server/static/order.js +++ b/server/static/order.js @@ -1,48 +1,58 @@ +var subtotal = 0; var editingSpecialId = null; +var activeCatalogueTags = []; +var activeCakeTags = []; +// ====== Sidebar ====== +function toggleSidebar() { + document.body.classList.toggle('sidebar-collapsed'); + localStorage.setItem('sidebarCollapsed', document.body.classList.contains('sidebar-collapsed')); +} + +// ====== Overlay ====== function openSpecialCakeOverlay() { editingSpecialId = null; - document.getElementById("sc-overlay-title").textContent = "Dodaj tort specjalny"; - document.getElementById("sc-name").value = ""; - document.getElementById("sc-price").value = ""; - document.getElementById("sc-size").value = ""; - document.getElementById("sc-shape").value = ""; - document.getElementById("sc-flavour").value = ""; - document.getElementById("sc-notes").value = ""; - document.getElementById("sc-new-tag").value = ""; - var cbs = document.querySelectorAll(".sc-tag-cb"); + document.getElementById('sc-overlay-title').textContent = 'Dodaj tort specjalny'; + document.getElementById('sc-name').value = ''; + document.getElementById('sc-price').value = ''; + document.getElementById('sc-size').value = ''; + document.getElementById('sc-shape').value = ''; + document.getElementById('sc-flavour').value = ''; + document.getElementById('sc-notes').value = ''; + document.getElementById('sc-new-tag').value = ''; + var cbs = document.querySelectorAll('.sc-tag-cb'); for (var i = 0; i < cbs.length; i++) cbs[i].checked = false; - document.getElementById("sc-overlay").classList.add("open"); - document.getElementById("sc-name").focus(); + document.getElementById('sc-overlay').classList.add('open'); + document.getElementById('sc-name').focus(); } function closeSpecialCakeOverlay() { - document.getElementById("sc-overlay").classList.remove("open"); + document.getElementById('sc-overlay').classList.remove('open'); editingSpecialId = null; } function getOverlayFormData() { return { - name: document.getElementById("sc-name").value.trim(), - price: document.getElementById("sc-price").value, - size: document.getElementById("sc-size").value.trim(), - shape: document.getElementById("sc-shape").value, - flavour: document.getElementById("sc-flavour").value.trim(), - notes: document.getElementById("sc-notes").value.trim(), + name: document.getElementById('sc-name').value.trim(), + price: document.getElementById('sc-price').value, + size: document.getElementById('sc-size').value.trim(), + shape: document.getElementById('sc-shape').value, + flavour: document.getElementById('sc-flavour').value.trim(), + notes: document.getElementById('sc-notes').value.trim(), tagIds: (function() { var ids = []; - var cbs = document.querySelectorAll(".sc-tag-cb:checked"); + var cbs = document.querySelectorAll('.sc-tag-cb:checked'); for (var i = 0; i < cbs.length; i++) ids.push(cbs[i].value); return ids; })(), tagNames: (function() { var names = []; - var cbs = document.querySelectorAll(".sc-tag-cb:checked"); + var cbs = document.querySelectorAll('.sc-tag-cb:checked'); for (var i = 0; i < cbs.length; i++) - names.push(cbs[i].closest(".tag-chip").textContent.trim()); + names.push(cbs[i].closest('.tag-chip').textContent.trim()); return names; })(), - newTag: document.getElementById("sc-new-tag").value.trim() + newTag: document.getElementById('sc-new-tag').value.trim() }; } @@ -50,30 +60,30 @@ function buildSpecialCakeHTML(d) { var parts = []; if (d.size) parts.push(d.size); if (d.flavour) parts.push(d.flavour); - if (d.shape === "round") parts.push("okragly"); - else if (d.shape === "square") parts.push("kwadrat"); - if (d.notes) parts.push("notatka: " + d.notes); - var detail = parts.length ? parts.join(", ") : ""; - var tagHtml = d.tagNames.length > 0 || d.newTag ? '
Brak zablokowanych terminów
+Brak zablokowanych terminów
} else {