Files
Aberwyn/Aberwyn/wwwroot/css/budget.css
2026-01-24 16:52:55 +01:00

781 lines
15 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
:root {
--text-main: #1F2937; /* Mörkblågrå tydlig men mjuk */
--text-sub: #64748B; /* Sekundär gråblå */
--bg-main: #1F2C3C; /* SID-bakgrund */
--bg-card: #dbe3ec;
--bg-card-summary: #d6dde6;
--border-color: #cbd5e1; /* Ljus kant men inte skarp */
--item-divider: rgba(0, 0, 0, 0.05); /* ljus standard */
--card-income: #fb923c;
--card-expense: #ef4444;
--card-savings: #facc15;
--card-leftover: #4ade80;
--btn-edit: #3b82f6;
--btn-check: #10b981;
--btn-delete: #ef4444;
}
body {
background-color: var(--bg-main);
color: var(--text-main);
font-family: 'Segoe UI', sans-serif;
font-size: 14px;
font-weight: 500;
}
.budget-page {
padding: 16px 24px;
margin-left: 0;
max-width: unset;
}
.budget-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
flex-wrap: wrap;
gap: 12px;
padding-right: 8px;
}
.month-nav-bar {
display: flex;
align-items: center;
gap: 6px;
position: relative;
}
.month-label {
padding: 4px 10px;
background-color: #e2e8f0;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
font-size: 16px;
text-align: center;
min-width: 90px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.menu-container {
position: relative;
}
.month-picker-dropdown select,
.month-picker-dropdown input {
font-size: 13px;
padding: 5px;
border-radius: 6px;
border: 1px solid var(--border-color);
width: 100%;
box-sizing: border-box;
margin-bottom: 6px;
}
.nav-button {
background-color: #e2e8f0;
color: var(--text-main);
border: none;
padding: 4px 8px;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
transition: background 0.2s;
font-size: 16px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-button:hover {
background-color: #cbd5e1;
}
.budget-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap:10px;
align-items: stretch;
}
.budget-card {
display: flex;
flex-direction: column;
width: 100%;
height: 350px;
border: 1px solid var(--border-color);
border-radius: 12px;
color: var(--text-main);
background-color: var(--bg-card);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.item-list {
flex-grow: 1;
overflow-y: auto;
padding: 2px 8px;
display: flex;
flex-direction: column;
position: relative;
}
.item-row:last-child {
margin-bottom: 5px;
}
.total-row {
padding: 2px 8px;
font-weight: bold;
font-size: 13px;
background: #f1f5f9;
border-top: 1px solid var(--border-color);
border-radius: 0 0 12px 12px;
flex-shrink: 0;
background: var(--bg-card-summary);
}
.card-header {
border-radius: 12px 12px 0 0;
position: sticky;
top: 0;
z-index: 3; /* högre än total-row */
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
font-weight: 600;
color: #ffffff;
font-size: 14px;
flex-wrap: wrap;
gap: 6px;
}
.header-edit {
padding: 4px 8px;
border-radius: 6px;
border: 1px solid var(--border-color);
flex: 1;
min-width: 120px; /* om du vill att den ska vara större */
}
.card-header.income {
background-color: var(--card-income);
}
.card-header.expense {
background-color: var(--card-expense);
}
.card-header.savings {
background-color: var(--card-savings);
}
.card-header.leftover {
background-color: var(--card-leftover);
}
.item-row {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
gap: 0px;
font-size: 13px;
}
.item-list::-webkit-scrollbar {
width: 6px;
}
.item-list::-webkit-scrollbar-thumb {
background-color: rgba(100, 116, 139, 0.2);
border-radius: 3px;
}
.item-list::-webkit-scrollbar-track {
background: transparent;
}
/* === För Firefox === */
.item-list {
scrollbar-width: thin;
scrollbar-color: rgba(100, 116, 139, 0.2) transparent;
}
.item-row input[type="text"] {
flex: 1;
padding: 5px 6px;
font-size: 13px;
border: 1px solid var(--border-color);
border-radius: 6px;
background-color: #ffffff;
color: var(--text-main);
font-weight: 500;
min-width: 70px;
}
.item-row input[type="number"] {
flex: 1;
padding: 5px 6px;
font-size: 13px;
border: 1px solid var(--border-color);
border-radius: 6px;
background-color: #ffffff;
color: var(--text-main);
font-weight: 500;
max-width: 60px;
}
.amount {
min-width: 70px;
text-align: right;
font-weight: 600;
}
@keyframes fadeRed {
0% {
color: rgb(200, 50, 50);
}
100% {
color: rgb(160, 0, 0);
}
}
@keyframes fadeGreen {
0% {
color: rgb(50, 200, 50);
}
100% {
color: rgb(0, 160, 0);
}
}
.item-row.due {
animation: fadeRed 0.2s ease-in-out;
animation-fill-mode: forwards;
}
.item-row.paid {
animation: fadeGreen 0.2s ease-in-out;
animation-fill-mode: forwards;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
font-size: 13px;
padding: 4px;
transition: color 0.2s;
}
.icon-button:hover {
color: #000000;
}
.icon-button.danger {
color: var(--btn-delete);
}
.icon-button.danger:hover {
color: #b91c1c;
}
.icon-button.edit {
color: var(--btn-edit);
}
.icon-button.confirm {
color: var(--btn-check);
}
.menu-container {
position: relative;
display: inline-block;
}
.dropdown-menu {
position: absolute;
top: calc(100% + 6px);
left: auto;
right: 0;
transform: translateX(-100%) translateX(100%); /* Effektivt: ingen förskjutning */
background-color: #ffffff;
border: 1px solid var(--border-color);
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 1000;
padding: 6px;
display: none;
flex-direction: column;
min-width: 160px;
max-width: 240px;
box-sizing: border-box;
}
.menu-container.open .dropdown-menu {
display: flex;
}
.dropdown-menu button {
padding: 6px 10px;
border-radius: 6px;
border: none;
background: #f3f4f6;
cursor: pointer;
font-size: 13px;
text-align: left;
width: 100%;
}
.dropdown-menu button:hover {
background-color: #e5e7eb;
}
.no-data {
text-align: center;
padding: 16px;
font-size: 14px;
color: var(--text-sub);
border: 1px dashed var(--border-color);
border-radius: 8px;
background-color: #fff;
margin-top: 12px;
font-weight: 500;
}
.toast {
position: fixed;
bottom: 20px;
right: 20px;
background: #10B981;
color: white;
padding: 10px 16px;
border-radius: 6px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
opacity: 0;
transform: translateY(20px);
transition: opacity 0.3s, transform 0.3s;
z-index: 9999;
font-weight: 500;
}
.toast.show {
opacity: 1;
transform: translateY(0);
}
.toast.error {
background: #ef4444;
}
/* === Dropzones === */
.drop-placeholder {
height: 0px;
transition: all 0.2s ease;
margin: 0;
}
.drop-placeholder.drag-over {
border-top: 3px solid #3B82F6;
height: 40px; /* gör det mer tydligt när man drar */
transition: height 0.2s ease;
}
/* Gör att man ser var man kan släppa */
.drop-zone.active-drop-target {
height: 12px;
background-color: rgba(22, 163, 74, 0.1); /* svagt grön basfärg */
}
.drop-zone.drag-over {
border: 2px dashed #16a34a; /* grön */
background-color: rgba(22, 163, 74, 0.1);
}
.item-floating-menu {
position: fixed !important; /* viktig för att den inte ska följa DOM-flödet */
z-index: 9999 !important; /* se till att inget annat ligger över */
background: #1F2C3C;
color: #fff;
border: 1px solid #444;
border-radius: 6px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
padding: 4px 0px 4px 0;
min-width: 20px;
max-width: 130px;
display: block;
}
.item-floating-menu button {
background: none;
border: none;
color: #fff;
text-align: left;
padding: 8px 16px;
width: 100%;
cursor: pointer;
}
.item-floating-menu button:hover {
background: #333;
}
.item-floating-menu button.disabled {
color: #aaa;
pointer-events: none;
font-style: italic;
}
.add-item-popup {
position: absolute; /* ← Ändrat från fixed */
z-index: 9999;
background-color: #1F2C3C;
color: white;
border: 1px solid #444;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
padding: 14px;
width: 280px;
font-size: 14px;
margin-top: 6px;
}
.add-item-popup.above {
margin-top: unset;
margin-bottom: 6px;
}
.add-item-popup label {
display: block;
margin-top: 8px;
font-weight: 600;
font-size: 13px;
color: #cbd5e1;
}
.add-item-popup input,
.add-item-popup select {
width: 100%;
padding: 6px 8px;
border: none;
border-radius: 6px;
margin-top: 4px;
font-size: 13px;
box-sizing: border-box;
background-color: #334155;
color: white;
}
.add-item-popup input::placeholder {
color: #94a3b8;
}
.add-item-popup button {
margin-top: 12px;
margin-right: 8px;
padding: 6px 12px;
background-color: #3b82f6;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background-color 0.2s;
}
.add-item-popup button:hover {
background-color: #2563eb;
}
.add-post-btn {
margin: 10px 0 6px 0;
padding: 6px 10px;
background-color: #3b82f6;
color: white;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
transition: background-color 0.2s ease;
display: inline-flex;
align-items: center;
gap: 6px;
}
.add-post-btn:hover {
background-color: #2563eb;
}
.suggestion-list {
position: absolute;
background: #1F2C3C;
color: white;
border: 1px solid #555;
border-radius: 4px;
margin-top: 4px;
padding: 0;
list-style: none;
width: 100%;
max-height: 150px;
overflow-y: auto;
z-index: 10000; /* 👈 ovanför resten */
}
.suggestion-list li {
padding: 6px 10px;
cursor: pointer;
}
.suggestion-list li:hover {
background: #334155;
}
/* Summary */
.budget-overview-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 8px 0 16px;
}
.budget-summary-box,
.budget-chart-box {
flex: 1 1 250px;
background-color: var(--bg-card);
padding: 8px 12px;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
min-width: 220px;
background-color: var(--bg-card);
color: var(--text-main);
}
.budget-summary-box h3,
.budget-chart-box h3 {
margin: 0 0 6px;
font-size: 13px;
font-weight: 600;
color: var(--text-main);
}
.summary-list,
.category-summary-list {
list-style: none;
padding: 0;
margin: 0;
}
.summary-list li,
.category-summary-list li {
display: flex;
justify-content: space-between;
padding: 1px 0;
font-size: 12px;
font-weight: 500;
line-height: 1.4;
color: var(--text-main);
}
.summary-list li span:first-child {
font-weight: 600;
color: var(--text-sub);
}
.category-summary-list li {
border-top: 1px dashed var(--border-color);
padding: 3px 0;
font-size: 11.5px;
}
.highlight {
font-weight: 700;
}
.highlight.leftover.plus {
color: #15803d;
}
.highlight.leftover.minus {
color: #dc2626;
}
/* chart */
.chart-area {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.chart-legend h4 {
margin: 0 0 6px;
font-size: 13px;
font-weight: 600;
}
.chart-area {
flex: 1;
min-width: 200px;
max-width: 340px;
}
canvas {
max-width: 100%;
height: auto;
}
body.dark-mode {
--item-divider: rgba(255, 255, 255, 0.05); /* för mörk bakgrund */
}
.item-row:not(.total-row) {
border-bottom: 1px solid var(--item-divider);
padding-bottom: 4px;
margin-bottom: 4px;
}
@media (min-width: 769px) {
.budget-overview-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
align-items: start;
}
.budget-chart-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 300px;
text-align: center;
}
.budget-chart-box .chart-row {
display: flex;
justify-content: center;
align-items: center;
}
.budget-chart-box .chart-area {
flex: 1;
max-width: 420px;
width: 100%;
}
.budget-chart-box canvas {
max-width: 100%;
height: auto;
}
.item-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border-color);
}
.item-label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
display: inline-block;
}
.amount {
flex-shrink: 0;
white-space: nowrap;
font-weight: bold;
}
}
@media (max-width: 768px) {
.item-label {
white-space: normal;
overflow-wrap: break-word;
word-break: break-word;
flex: 1 1 auto;
max-width: 100%;
}
.amount {
white-space: nowrap;
text-align: right;
flex-shrink: 0;
}
.budget-grid {
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.budget-overview-row {
display: flex;
flex-direction: column;
gap: 12px;
}
.budget-summary-box,
.budget-chart-box {
width: 100%;
}
.chart-row {
flex-direction: column;
align-items: center;
}
.chart-area {
max-width: 100%;
}
.chart-legend {
width: 100%;
text-align: center;
padding-bottom: 10px;
color: #1E293B; /* djupare textfärg */
font-weight: 600;
}
.chart-area canvas {
max-width: 240px;
height: auto;
}
}
.loading-indicator {
text-align: center;
margin-top: 40px;
font-size: 18px;
color: #64748B;
font-style: italic;
}
[ng-cloak] {
display: none !important;
}