Refactor CSS styles and introduce theme variables

- Removed redundant CSS rules and consolidated styles across dashboard, forms, imports, projects, and scenarios.
- Introduced new color variables in theme-default.css for better maintainability and consistency.
- Updated existing styles to utilize new color variables, enhancing the overall design.
- Improved responsiveness and layout of various components, including tables and cards.
- Ensured consistent styling for buttons, links, and headers across the application.
This commit is contained in:
2025-11-13 22:30:58 +01:00
parent fb6816de00
commit 1262a4a63f
8 changed files with 453 additions and 675 deletions

View File

@@ -1,43 +1,12 @@
:root {
--bg: #0b0f14;
--bg-2: #0f141b;
--card: #151b23;
--text: #e6edf3;
--muted: #a9b4c0;
--brand: #f1b21a;
--brand-2: #f6c648;
--brand-3: #f9d475;
--accent: #2ba58f;
--danger: #d14b4b;
--shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
/* Radii & layout */
--radius: 14px;
--radius-sm: 10px;
--panel-radius: var(--radius);
--table-radius: var(--radius-sm);
--container: 1180px;
--muted: var(--muted);
--color-text-subtle: rgba(169, 180, 192, 0.6);
--color-text-invert: #ffffff;
--color-text-dark: #0f172a;
--color-text-strong: #111827;
--color-border: rgba(255, 255, 255, 0.08);
--card-border: rgba(255, 255, 255, 0.08);
--color-border-strong: rgba(255, 255, 255, 0.12);
--color-highlight: rgba(241, 178, 26, 0.08);
--color-panel-shadow: rgba(0, 0, 0, 0.25);
--color-panel-shadow-deep: rgba(0, 0, 0, 0.35);
--color-surface-alt: rgba(21, 27, 35, 0.7);
--btn-primary-bg: var(--brand-2);
--btn-primary-color: var(--color-text-dark);
--btn-primary-hover: var(--brand-3);
--btn-secondary-bg: rgba(21, 27, 35, 0.85);
--btn-secondary-hover: rgba(21, 27, 35, 0.95);
--btn-secondary-border: var(--color-border-strong);
--btn-secondary-color: var(--text);
--btn-danger-bg: var(--danger);
--btn-danger-color: #ffffff;
--btn-danger-hover: #e56a6a;
--btn-link-color: var(--brand-2);
--btn-link-hover: var(--brand-3);
--btn-ghost-color: var(--muted);
/* Spacing & typography */
--space-2xs: 0.25rem;
--space-xs: 0.5rem;
--space-sm: 0.75rem;
@@ -45,18 +14,13 @@
--space-lg: 1.5rem;
--space-xl: 2rem;
--space-2xl: 3rem;
--font-size-xs: 0.75rem;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.25rem;
--font-size-xl: 1.5rem;
--font-size-2xl: 2rem;
--panel-radius: var(--radius);
--table-radius: var(--radius-sm);
}
* {
box-sizing: border-box;
}
html,
@@ -73,6 +37,13 @@ body {
line-height: 1.45;
}
.header-actions {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
justify-content: flex-end;
}
h1,
h2,
h3,
@@ -180,6 +151,36 @@ a {
color: var(--text);
}
.metric-card {
background: var(--color-surface-overlay);
border-radius: var(--radius);
padding: 1.5rem;
box-shadow: var(--shadow);
border: 1px solid var(--color-border);
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.metric-card h2 {
margin: 0;
font-size: 1rem;
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.metric-value {
font-size: 2rem;
font-weight: 700;
margin: 0;
}
.metric-caption {
color: var(--color-text-subtle);
font-size: 0.85rem;
}
.metrics-table {
width: 100%;
border-collapse: collapse;
@@ -197,7 +198,7 @@ a {
.metrics-table th {
font-weight: 600;
color: var(--text);
color: var(--color-text-dark);
}
.metrics-table tr:last-child td,
@@ -208,23 +209,30 @@ a {
.definition-list {
margin: 0;
display: grid;
gap: 0.75rem;
gap: 1.25rem 2rem;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.definition-list div {
display: grid;
grid-template-columns: 140px 1fr;
grid-template-columns: minmax(140px, 0.6fr) minmax(0, 1fr);
gap: 0.5rem;
align-items: baseline;
}
.definition-list dt {
color: var(--muted);
margin: 0;
font-weight: 600;
color: var(--color-text-muted);
text-transform: uppercase;
font-size: 0.75rem;
letter-spacing: 0.08em;
}
.definition-list dd {
margin: 0;
font-size: 1rem;
color: var(--color-text-primary);
}
.scenario-card {
@@ -254,6 +262,13 @@ a {
}
.scenario-meta {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1.25rem;
}
.scenario-card .scenario-meta {
display: block;
text-align: right;
}
@@ -299,6 +314,201 @@ a {
color: var(--muted);
}
.quick-link-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 1rem;
}
.quick-link-list li a {
font-weight: 600;
color: var(--brand-2);
text-decoration: none;
}
.quick-link-list li a:hover,
.quick-link-list li a:focus {
text-decoration: underline;
}
.quick-link-list p {
margin: 0.25rem 0 0;
color: var(--color-text-subtle);
font-size: 0.9rem;
}
.scenario-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 1rem;
}
.scenario-item {
background: rgba(21, 27, 35, 0.85);
background: color-mix(in srgb, var(--color-surface-default) 85%, transparent);
border: 1px solid var(--color-border);
border-radius: var(--radius);
padding: 1.25rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.scenario-item__body {
display: flex;
flex-direction: column;
gap: 1rem;
}
.scenario-item__header {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
justify-content: space-between;
}
.scenario-item__header h3 {
margin: 0;
font-size: 1.1rem;
}
.scenario-item__header a {
color: inherit;
text-decoration: none;
}
.scenario-item__header a:hover,
.scenario-item__header a:focus {
text-decoration: underline;
}
.scenario-item__meta {
display: grid;
gap: 0.75rem;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.scenario-item__meta dt {
margin: 0;
font-size: 0.75rem;
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
.scenario-item__meta dd {
margin: 0;
font-size: 0.95rem;
}
.scenario-item__actions {
display: flex;
gap: 0.75rem;
flex-wrap: wrap;
}
.scenario-item__actions .btn--link {
padding: 0;
}
.status-pill {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.35rem 0.85rem;
border-radius: 999px;
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.status-pill--draft {
background: rgba(59, 130, 246, 0.15);
color: #93c5fd;
background: color-mix(in srgb, var(--color-info) 18%, transparent);
color: color-mix(in srgb, var(--color-info) 70%, white);
}
.status-pill--active {
background: rgba(34, 197, 94, 0.18);
color: #86efac;
background: color-mix(in srgb, var(--color-success) 18%, transparent);
color: color-mix(in srgb, var(--color-success) 70%, white);
}
.status-pill--archived {
background: rgba(148, 163, 184, 0.24);
color: #cbd5f5;
background: color-mix(in srgb, var(--color-text-muted) 24%, transparent);
color: color-mix(in srgb, var(--color-text-muted) 60%, white);
}
.empty-state {
color: var(--color-text-muted);
font-style: italic;
}
.table {
width: 100%;
border-collapse: collapse;
border-radius: var(--table-radius);
overflow: hidden;
box-shadow: var(--shadow);
}
.table th,
.table td {
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--color-border);
background: rgba(21, 27, 35, 0.85);
background: color-mix(in srgb, var(--color-surface-default) 85%, transparent);
}
.table tbody tr:hover {
background: rgba(241, 178, 26, 0.12);
background: var(--color-highlight);
}
.table-link {
color: var(--brand-2);
text-decoration: none;
margin-left: 0.5rem;
}
.table-link:hover,
.table-link:focus {
text-decoration: underline;
}
.table-responsive {
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
border-radius: var(--table-radius);
margin: 0;
}
.table-responsive .table {
min-width: 640px;
}
.table-responsive::-webkit-scrollbar {
height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
background: color-mix(in srgb, var(--color-text-invert) 20%, transparent);
border-radius: 999px;
}
.page-actions .button {
text-decoration: none;
background: transparent;
@@ -559,7 +769,7 @@ a.sidebar-brand:focus {
.dashboard-header {
display: flex;
align-items: flex-start;
align-items: center;
justify-content: space-between;
gap: 1.5rem;
margin-bottom: 2rem;
@@ -959,23 +1169,6 @@ a.sidebar-brand:focus {
background-color: var(--btn-secondary-hover);
}
.btn--danger,
.btn.danger,
.btn.btn-danger {
background-color: var(--btn-danger-bg);
border-color: transparent;
color: var(--btn-danger-color);
}
.btn--danger:hover,
.btn--danger:focus,
.btn.danger:hover,
.btn.danger:focus,
.btn.btn-danger:hover,
.btn.btn-danger:focus {
background-color: var(--btn-danger-hover);
}
.btn--link,
.btn.btn-link,
.btn.link {
@@ -999,17 +1192,14 @@ a.sidebar-brand:focus {
text-decoration: underline;
}
.btn--ghost,
.btn.btn-ghost {
.btn--ghost {
background: transparent;
border: 1px solid transparent;
color: var(--btn-ghost-color);
}
.btn--ghost:hover,
.btn--ghost:focus,
.btn.btn-ghost:hover,
.btn.btn-ghost:focus {
.btn--ghost:focus {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.2);
}
@@ -1224,10 +1414,62 @@ footer a:focus {
transition: opacity 0.25s ease;
}
@media (min-width: 720px) {
.table-responsive .table {
min-width: 100%;
}
}
@media (max-width: 640px) {
.table th,
.table td {
padding: 0.55rem 0.65rem;
font-size: 0.9rem;
white-space: nowrap;
}
.table tbody tr {
border-radius: var(--radius-sm);
}
.metric-card {
padding: 1.25rem;
}
.metric-value {
font-size: 1.75rem;
}
.header-actions {
flex-direction: column;
align-items: stretch;
}
}
@media (min-width: 960px) {
.header-actions {
justify-content: flex-start;
}
.scenario-item {
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.scenario-item__body {
max-width: 70%;
}
}
@media (max-width: 1024px) {
.app-sidebar {
width: 240px;
}
.header-actions {
justify-content: flex-start;
}
}
@media (max-width: 900px) {