Files
tilbudgivern/frontend/src/MaterialsList.css
T

1248 lines
22 KiB
CSS

/* =====================================================
MATERIALS LIST - Clean, Modern Excel-Style Table
===================================================== */
* {
box-sizing: border-box;
}
/* =====================================================
PAGE LAYOUT
===================================================== */
.materials-list-view {
width: 100%;
background: #f5f6f7;
min-height: 100vh;
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* =====================================================
HEADER
===================================================== */
.materials-header {
background: white;
padding: 32px 24px;
border-bottom: 1px solid #e0e0e0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.materials-header h2 {
margin: 0 0 8px 0;
font-size: 32px;
font-weight: 700;
color: #1a1a1a;
}
.materials-header p {
margin: 0 0 24px 0;
font-size: 16px;
color: #666;
font-weight: 400;
}
.materials-controls {
display: flex;
flex-direction: column;
gap: 16px;
}
.action-controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
}
.add-btn,
.refresh-btn,
.import-btn,
.manual-scraper-btn {
padding: 10px 16px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
white-space: nowrap;
}
.add-btn {
background: var(--ui-ink-900, #0d2538);
color: white;
}
.add-btn:hover {
background: var(--ui-ink-800, #123455);
box-shadow: 0 2px 6px rgba(13, 37, 56, 0.24);
}
.refresh-btn {
background: #f0f0f0;
color: #333;
border: 1px solid #d0d0d0;
}
.refresh-btn:hover:not(:disabled) {
background: #e0e0e0;
}
.refresh-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.import-btn {
background: var(--ui-ink-700, #244963);
color: white;
}
.import-btn:hover:not(:disabled) {
background: var(--ui-ink-800, #123455);
}
.import-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.manual-scraper-btn {
background: var(--ui-teal, #0f766e);
color: white;
}
.manual-scraper-btn:hover:not(:disabled) {
background: #0b5f59;
}
.manual-scraper-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* =====================================================
FORMS
===================================================== */
.new-material-form {
background: #f9f9f9;
padding: 20px;
border-radius: 6px;
border: 1px solid #e0e0e0;
margin-top: 16px;
}
.new-material-form h4 {
margin: 0 0 16px 0;
font-size: 16px;
font-weight: 600;
color: #1a1a1a;
}
.form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
margin-bottom: 16px;
}
.form-grid input,
.form-grid select {
padding: 10px 12px;
border: 1px solid #d0d0d0;
border-radius: 4px;
font-size: 14px;
background: white;
color: #333;
}
.form-grid input:focus,
.form-grid select:focus {
outline: none;
border-color: #4a90e2;
box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.form-actions {
display: flex;
gap: 12px;
}
.save-btn {
background: #27ae60;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.save-btn:hover:not(:disabled) {
background: #229954;
}
.save-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* =====================================================
SUMMARY & PAGINATION
===================================================== */
.materials-summary {
background: white;
padding: 20px 24px;
border-bottom: 1px solid #e0e0e0;
margin-bottom: 0;
}
.summary-stats {
display: flex;
gap: 32px;
flex-wrap: wrap;
margin-bottom: 20px;
}
.stat-item {
display: flex;
flex-direction: column;
gap: 4px;
}
.stat-label {
font-size: 13px;
color: #666;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.stat-value {
font-size: 24px;
font-weight: 700;
color: #1a1a1a;
}
.pagination-controls {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
flex-wrap: wrap;
}
.page-btn {
padding: 8px 14px;
border: 1px solid #d0d0d0;
background: white;
color: #333;
border-radius: 4px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
min-width: 70px;
}
.page-btn:hover:not(:disabled) {
background: #f0f0f0;
border-color: #999;
}
.page-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.page-info {
padding: 8px 16px;
background: #f9f9f9;
border: 1px solid #e0e0e0;
border-radius: 4px;
font-size: 14px;
color: #666;
font-weight: 500;
}
.items-per-page {
padding: 8px 12px;
border: 1px solid #d0d0d0;
border-radius: 4px;
background: white;
color: #333;
font-size: 14px;
cursor: pointer;
}
.items-per-page:focus {
outline: none;
border-color: #4a90e2;
box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
/* =====================================================
ERROR & LOADING STATES
===================================================== */
.error-message {
background: #fee;
color: #c62828;
padding: 12px 24px;
margin: 16px 24px;
border-radius: 4px;
border-left: 4px solid #c62828;
font-weight: 500;
font-size: 14px;
}
.loading-state,
.empty-state {
text-align: center;
padding: 60px 24px;
background: white;
color: #666;
margin: 0;
}
.loading-state p,
.empty-state p {
margin: 8px 0;
font-size: 16px;
}
/* =====================================================
TABLE CONTAINER & LAYOUT
===================================================== */
.materials-table-container {
background: white;
width: 100%;
overflow-x: auto;
overflow-y: visible;
margin: 0;
padding: 0;
}
.materials-table {
width: 100%;
border-collapse: collapse;
margin: 0;
padding: 0;
font-size: 14px;
line-height: 1.4;
background: white;
border: 1px solid #e0e0e0;
border-right: none;
border-bottom: none;
display: table !important;
table-layout: fixed !important;
}
/* =====================================================
TABLE HEADERS
===================================================== */
.materials-table thead {
display: table-header-group !important;
background: #f5f6f7;
border-bottom: 2px solid #d0d0d0;
}
.materials-table th {
padding: 12px 10px;
text-align: center;
font-weight: 700;
color: #1a1a1a;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.5px;
border-right: 1px solid #e0e0e0;
border-bottom: 1px solid #d0d0d0;
vertical-align: middle;
background: #f5f6f7;
display: table-cell !important;
}
.materials-table th:last-child {
border-right: none;
}
/* =====================================================
TABLE BODY & ROWS
===================================================== */
.materials-table tbody {
display: table-row-group !important;
}
.materials-table tr {
display: table-row !important;
border-bottom: 1px solid #e0e0e0;
height: auto;
}
.materials-table tbody tr:nth-child(even) {
background: #fafafa;
}
.materials-table tbody tr:hover {
background: #f0f8ff;
}
/* =====================================================
TABLE CELLS
===================================================== */
.materials-table td {
display: table-cell !important;
padding: 10px;
border-right: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
vertical-align: middle;
color: #333;
background: inherit;
height: auto;
line-height: 1.4;
}
.materials-table td:last-child {
border-right: none;
}
/* =====================================================
COLUMN WIDTHS & ALIGNMENT
===================================================== */
/* Column 1: Product Name (28%) - LEFT ALIGN */
.materials-table th:nth-child(1),
.materials-table td:nth-child(1) {
width: 28% !important;
text-align: left !important;
padding-left: 12px !important;
word-wrap: break-word !important;
white-space: normal !important;
}
/* Column 2: Product Code (10%) - CENTER */
.materials-table th:nth-child(2),
.materials-table td:nth-child(2) {
width: 10% !important;
text-align: center !important;
}
/* Column 3: Category (13%) - CENTER */
.materials-table th:nth-child(3),
.materials-table td:nth-child(3) {
width: 13% !important;
text-align: center !important;
}
/* Column 4: Supplier (10%) - CENTER */
.materials-table th:nth-child(4),
.materials-table td:nth-child(4) {
width: 10% !important;
text-align: center !important;
}
/* Column 5: Net Price (10%) - RIGHT ALIGN */
.materials-table th:nth-child(5),
.materials-table td:nth-child(5) {
width: 10% !important;
text-align: right !important;
padding-right: 12px !important;
}
/* Column 6: Gross Price (10%) - RIGHT ALIGN */
.materials-table th:nth-child(6),
.materials-table td:nth-child(6) {
width: 10% !important;
text-align: right !important;
padding-right: 12px !important;
}
/* Column 7: Unit (7%) - CENTER */
.materials-table th:nth-child(7),
.materials-table td:nth-child(7) {
width: 7% !important;
text-align: center !important;
}
/* Column 8: Actions (12%) - CENTER */
.materials-table th:nth-child(8),
.materials-table td:nth-child(8) {
width: 12% !important;
text-align: center !important;
}
/* =====================================================
BADGES & INLINE ELEMENTS
===================================================== */
.product-code-badge,
.category-badge,
.bygma-badge {
display: inline-block;
padding: 4px 8px;
border-radius: 3px;
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
.product-code-badge {
background: #f0f0f0;
color: #555;
font-family: 'Courier New', monospace;
border: 1px solid #e0e0e0;
}
.category-badge {
background: #e3f2fd;
color: #1976d2;
border: 1px solid #90caf9;
}
.bygma-badge {
background: #ff6b35;
color: white;
text-transform: uppercase;
letter-spacing: 0.5px;
border: none;
padding: 4px 8px;
font-size: 11px;
}
.price-cell {
font-variant-numeric: tabular-nums !important;
white-space: nowrap !important;
}
/* =====================================================
ACTIONS (BUTTONS IN TABLE)
===================================================== */
.actions {
display: flex !important;
justify-content: center;
align-items: center;
gap: 6px;
text-align: center !important;
flex-wrap: wrap;
}
.material-action-buttons {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
min-width: 0;
}
.edit-btn,
.delete-btn,
.save-edit-btn,
.cancel-edit-btn {
background: white;
border: 1px solid #d0d0d0;
padding: 6px 10px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: all 0.2s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.edit-btn {
background: #e3f2fd;
color: #1976d2;
border-color: #90caf9;
}
.edit-btn:hover {
background: #bbdefb;
box-shadow: 0 2px 6px rgba(25, 118, 210, 0.2);
}
.delete-btn {
background: #ffebee;
color: #c62828;
border-color: #ef9a9a;
}
.delete-btn:hover {
background: #ffcdd2;
box-shadow: 0 2px 6px rgba(198, 40, 40, 0.2);
}
.save-edit-btn {
background: #e8f5e9;
color: #2e7d32;
border-color: #a5d6a7;
}
.save-edit-btn:hover {
background: #c8e6c9;
}
.cancel-edit-btn {
background: #f5f5f5;
color: #666;
border-color: #bdbdbd;
}
.cancel-edit-btn:hover {
background: #eeeeee;
}
/* =====================================================
EDIT MODE INPUTS
===================================================== */
.edit-input,
.edit-select {
width: 100%;
padding: 6px 8px;
border: 1px solid #d0d0d0;
border-radius: 3px;
font-size: 14px;
background: white !important;
color: #333;
font-family: inherit;
}
.edit-input:focus,
.edit-select:focus {
outline: none;
border-color: #4a90e2;
box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
background: #f9f9ff !important;
}
.edit-input:-webkit-autofill,
.edit-input:-webkit-autofill:hover,
.edit-input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 1000px white inset !important;
-webkit-text-fill-color: #333 !important;
background-color: white !important;
}
/* =====================================================
FILTER CONTROLS (ABOVE TABLE)
===================================================== */
.table-filter-controls {
background: #f9f9f9;
padding: 16px 20px;
border-bottom: 1px solid #e0e0e0;
display: flex;
flex-wrap: wrap;
gap: 20px;
}
.filter-row {
display: flex;
gap: 20px;
flex-wrap: wrap;
width: 100%;
align-items: flex-end;
}
.filter-group,
.sort-group {
display: flex;
gap: 16px;
align-items: flex-end;
}
.filter-group label,
.sort-group label {
display: flex;
flex-direction: column;
gap: 6px;
}
.filter-group label span,
.sort-group label span {
font-weight: 600;
color: #333;
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.filter-group input,
.filter-group select,
.sort-group select {
padding: 8px 12px;
border: 1px solid #d0d0d0;
border-radius: 4px;
font-size: 14px;
background: white;
color: #333;
min-width: 140px;
}
.filter-group input:focus,
.filter-group select:focus,
.sort-group select:focus {
outline: none;
border-color: #4a90e2;
box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.search-container {
display: flex;
border: 1px solid #d0d0d0;
border-radius: 4px;
overflow: hidden;
background: white;
min-width: 240px;
}
.search-container input {
flex: 1;
border: none;
padding: 8px 12px;
font-size: 14px;
color: #333;
}
.search-container input:focus {
outline: none;
background: #f9f9ff;
}
.search-btn {
background: #4a90e2;
color: white;
border: none;
padding: 8px 12px;
cursor: pointer;
font-weight: 600;
transition: background 0.2s ease;
}
.search-btn:hover {
background: #2e5c8a;
}
/* =====================================================
MODALS
===================================================== */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
}
.modal-content {
background: white;
border-radius: 8px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 24px;
border-bottom: 1px solid #e0e0e0;
}
.modal-header h3 {
margin: 0;
font-size: 18px;
font-weight: 700;
color: #1a1a1a;
}
.close-btn {
background: none;
border: none;
font-size: 28px;
cursor: pointer;
color: #999;
padding: 0;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: all 0.2s ease;
}
.close-btn:hover {
background: #f0f0f0;
color: #333;
}
.modal-body {
padding: 24px;
}
/* =====================================================
MANUAL SCRAPER MODAL
===================================================== */
.manual-scraper-input {
margin-bottom: 20px;
}
.manual-scraper-input label {
display: block;
font-weight: 600;
margin-bottom: 8px;
color: #1a1a1a;
font-size: 14px;
}
.manual-scraper-input .input-group {
display: flex;
gap: 10px;
}
.manual-scraper-input input {
flex: 1;
padding: 10px 12px;
border: 1px solid #d0d0d0;
border-radius: 4px;
font-size: 14px;
font-family: 'Courier New', monospace;
}
.manual-scraper-input input:focus {
outline: none;
border-color: #9b59b6;
box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}
.scrape-btn {
padding: 10px 16px;
background: #9b59b6;
color: white;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
white-space: nowrap;
transition: background 0.2s ease;
}
.scrape-btn:hover:not(:disabled) {
background: #8e44ad;
}
.scrape-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.scraper-console {
background: #1e1e1e;
border-radius: 4px;
margin: 20px 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
overflow: hidden;
max-height: 400px;
display: flex;
flex-direction: column;
}
.console-header {
background: #2d2d2d;
padding: 10px 15px;
color: #9b59b6;
font-weight: 600;
font-size: 12px;
border-bottom: 1px solid #3d3d3d;
}
.console-content {
padding: 15px;
overflow-y: auto;
max-height: 320px;
font-family: 'Courier New', monospace;
font-size: 12px;
line-height: 1.6;
color: #d4d4d4;
}
.console-line {
margin: 2px 0;
white-space: pre-wrap;
word-break: break-word;
}
.reset-btn {
padding: 10px 20px;
background: white;
color: #9b59b6;
border: 2px solid #9b59b6;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
margin-top: 16px;
transition: all 0.2s ease;
}
.reset-btn:hover {
background: #9b59b6;
color: white;
}
/* =====================================================
BYGMA IMPORT MODAL
===================================================== */
.file-upload-section {
margin-bottom: 20px;
}
.file-label {
display: block;
padding: 20px;
background: #f9f9f9;
border: 2px dashed #d0d0d0;
border-radius: 4px;
text-align: center;
cursor: pointer;
transition: all 0.2s ease;
color: #666;
font-weight: 500;
}
.file-label:hover {
border-color: #ff6b35;
background: #fff5f2;
color: #ff6b35;
}
#bygma-csv-input {
display: none;
}
.upload-btn {
width: 100%;
padding: 12px;
background: #ff6b35;
color: white;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
font-size: 14px;
transition: all 0.2s ease;
}
.upload-btn:hover:not(:disabled) {
background: #e55a27;
}
.upload-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.import-status {
text-align: center;
padding: 20px;
}
.loading-spinner {
width: 50px;
height: 50px;
border: 4px solid #f0f0f0;
border-top: 4px solid #ff6b35;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 16px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.import-success,
.import-error {
text-align: center;
padding: 20px;
}
.import-success h4,
.import-error h4 {
margin: 0 0 16px 0;
font-size: 16px;
font-weight: 700;
color: #1a1a1a;
}
.import-stats {
background: #f9f9f9;
border-radius: 4px;
padding: 16px;
margin: 20px 0;
text-align: left;
}
.import-stats p {
margin: 8px 0;
font-size: 14px;
color: #333;
}
.retry-btn {
padding: 10px 20px;
background: white;
color: #1a1a1a;
border: 1px solid #d0d0d0;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
margin-top: 16px;
transition: all 0.2s ease;
}
.retry-btn:hover {
background: #f0f0f0;
border-color: #999;
}
/* =====================================================
RESPONSIVE
===================================================== */
@media (max-width: 1024px) {
.materials-table {
font-size: 13px;
}
.materials-table th,
.materials-table td {
padding: 8px;
}
}
@media (max-width: 768px) {
.materials-header {
padding: 20px 16px;
}
.materials-header h2 {
font-size: 24px;
}
.materials-summary {
padding: 16px;
}
.action-controls {
flex-direction: column;
align-items: stretch;
}
.add-btn,
.refresh-btn,
.import-btn,
.manual-scraper-btn {
width: 100%;
}
.table-filter-controls {
flex-direction: column;
padding: 12px 16px;
}
.filter-row,
.filter-group,
.sort-group {
flex-direction: column;
width: 100%;
}
.filter-group label,
.sort-group label {
width: 100%;
}
.filter-group input,
.filter-group select,
.sort-group select,
.search-container {
width: 100%;
min-width: auto;
}
.summary-stats {
gap: 16px;
}
.materials-table-container {
overflow: visible;
}
.materials-table {
display: block !important;
min-width: 0;
border: 0;
background: transparent;
}
.materials-table thead {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.materials-table tbody {
display: grid !important;
gap: 12px;
padding: 0 16px 16px;
}
.materials-table tr {
display: block !important;
overflow: hidden;
height: auto;
border: 1px solid #dbe3ea;
border-radius: 10px;
background: #fff;
box-shadow: 0 2px 8px rgba(13, 37, 56, 0.08);
}
.materials-table tbody tr:nth-child(even),
.materials-table tbody tr:hover {
background: #fff;
}
.materials-table td,
.materials-table td:nth-child(n) {
display: grid !important;
grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.4fr);
gap: 12px;
align-items: center;
width: 100% !important;
min-height: 42px;
padding: 9px 12px !important;
border-right: 0;
border-bottom: 1px solid #edf1f4;
text-align: left !important;
overflow-wrap: anywhere;
}
.materials-table td:first-child {
padding-top: 12px !important;
font-weight: 700;
color: #0d2538;
}
.materials-table td:last-child {
padding-bottom: 12px !important;
border-bottom: 0;
}
.materials-table td::before {
content: attr(data-label);
color: #64748b;
font-size: 11px;
font-weight: 700;
line-height: 1.2;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.materials-table .actions {
justify-content: initial;
}
.materials-table .material-action-buttons {
justify-content: flex-start;
}
.materials-table .product-code-badge,
.materials-table .category-badge,
.materials-table .bygma-badge {
max-width: 100%;
white-space: normal;
overflow-wrap: anywhere;
}
.materials-table .edit-input,
.materials-table .edit-select {
width: 100%;
min-width: 0;
}
.modal-content {
width: 95%;
}
}
@media (max-width: 480px) {
.materials-list-view {
padding: 0;
}
.materials-header {
padding: 16px;
}
.materials-header h2 {
font-size: 20px;
}
.materials-table {
font-size: 14px;
}
.materials-table tbody {
padding: 0 12px 12px;
}
.materials-table td,
.materials-table td:nth-child(n) {
grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1.25fr);
gap: 10px;
}
.summary-stats {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
}