visual-spending/styles.css
Anton Volnuhin 0bc2725d4d Use system font with proper ₽ symbol and fix modal close behavior
- Switch to SF Pro / system font stack for consistent ₽ rendering
- Apply font to both HTML and ECharts center text
- Reset chart highlight and details panel when closing modal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:29:27 +03:00

605 lines
11 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #f5f5f5;
color: #333;
}
.container {
width: 100%;
margin: 0 auto;
padding: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
/* Month Navigator */
.month-navigator {
display: flex;
align-items: center;
gap: 8px;
max-width: 60%;
}
.nav-arrow {
width: 36px;
height: 36px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: white;
font-size: 24px;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s, border-color 0.2s;
flex-shrink: 0;
}
.nav-arrow:hover:not(:disabled) {
background-color: #f0f0f0;
border-color: #999;
}
.nav-arrow:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.month-list {
display: flex;
gap: 6px;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
.month-list::-webkit-scrollbar {
display: none;
}
.month-btn {
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: white;
font-size: 14px;
cursor: pointer;
white-space: nowrap;
transition: background-color 0.2s, border-color 0.2s, color 0.2s;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.month-btn:hover {
background-color: #f0f0f0;
border-color: #999;
}
.month-btn.active {
background-color: #5470c6;
border-color: #5470c6;
color: white;
}
.month-preview {
width: 40px;
height: 40px;
border-radius: 50%;
border: 1px solid #eee;
position: relative;
}
.month-preview::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 35%;
height: 35%;
background: white;
border-radius: 50%;
}
.month-btn.active .month-preview {
border-color: rgba(255, 255, 255, 0.3);
}
.month-btn.active .month-preview::after {
background: #5470c6;
}
.month-label {
font-size: 12px;
}
.content-wrapper {
display: flex;
position: relative;
}
#chart-container {
width: 70%;
height: 80vh;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* Override ECharts default pointer cursor - only eye button should have pointer */
#chart-container canvas {
cursor: default !important;
}
#details-box {
position: absolute;
top: 10px;
right: 10px;
width: 35vw;
min-width: 300px;
max-width: 650px;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
padding: 20px;
z-index: 10;
min-height: auto;
max-height: 80vh;
overflow-y: auto;
opacity: 0.98;
border: 1px solid #eee;
margin-left: 0;
}
#details-box h3 {
margin-bottom: 15px;
color: #333;
font-size: 18px;
border-bottom: 1px solid #eee;
padding-bottom: 8px;
}
#details-box h4 {
margin: 10px 0 5px;
color: #555;
font-size: 14px;
}
.details-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding: 10px 0;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
}
.hover-name {
font-weight: bold;
color: #333;
word-break: break-word;
flex: 1;
display: flex;
align-items: center;
font-size: 16px;
}
.hover-amount {
font-size: 18px;
color: #0066cc;
font-weight: bold;
margin-left: 10px;
white-space: nowrap;
text-align: right;
min-width: 120px;
}
.color-circle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 8px;
flex-shrink: 0;
}
#top-items {
font-size: 14px;
}
.top-item {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px dashed #eee;
}
.top-item:last-child {
border-bottom: none;
}
.top-item-name {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
min-width: 0;
}
.top-item-amount {
margin-left: 15px;
font-weight: bold;
min-width: 120px;
text-align: right;
flex-shrink: 0;
}
/* Add responsive design for smaller screens */
@media (max-width: 1200px) {
#details-box {
max-width: 300px;
}
}
@media (max-width: 850px) {
.header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
.month-navigator {
max-width: 100%;
width: 100%;
}
.content-wrapper {
flex-direction: column;
}
#chart-container {
width: 100%;
height: 90lvw
}
#details-box {
position: relative;
top: 0;
right: 0;
width: 100%;
margin-top: 20px;
max-height: 300px;
min-width: 100%;
}
.top-item-amount {
min-width: 80px;
}
}
@media (max-width: 500px) {
.month-btn {
padding: 6px 8px;
font-size: 12px;
}
.month-preview {
width: 32px;
height: 32px;
}
.month-label {
font-size: 10px;
}
.nav-arrow {
width: 30px;
height: 30px;
font-size: 20px;
}
}
/* Eye button for transaction details */
.eye-btn {
opacity: 0;
background: none;
border: none;
cursor: pointer;
padding: 2px 6px;
margin-left: 4px;
transition: opacity 0.2s;
flex-shrink: 0;
color: #666;
display: flex;
align-items: center;
}
.top-item:hover .eye-btn {
opacity: 0.5;
}
.eye-btn:hover {
opacity: 1 !important;
color: #333;
}
/* Header eye button - show on hover like other items */
.details-header:hover .header-eye-btn {
opacity: 0.5;
}
/* Floating eye button on chart (shown when hovering over sunburst sector) */
.chart-eye-btn {
position: absolute;
z-index: 100;
background: transparent;
border: none;
border-radius: 50%;
width: 24px;
height: 24px;
cursor: pointer !important;
display: flex;
align-items: center;
justify-content: center;
filter: drop-shadow(0 0 2px rgba(255, 255, 255, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
transition: filter 0.15s, opacity 0.2s ease-out;
color: #111;
pointer-events: none;
opacity: 0;
}
.chart-eye-btn:hover {
filter: drop-shadow(0 0 2px rgba(255, 255, 255, 1)) drop-shadow(0 0 4px rgba(255, 255, 255, 1)) drop-shadow(0 0 6px rgba(255, 255, 255, 1));
color: #000;
}
.chart-eye-btn svg {
width: 14px;
height: 14px;
}
/* Modal styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal-content {
width: 90vw;
max-width: 1200px;
height: 80vh;
background-color: white;
border-radius: 12px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
overflow: hidden;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid #eee;
flex-shrink: 0;
}
.modal-header h2 {
margin: 0;
font-size: 18px;
color: #333;
}
.modal-close {
background: none;
border: none;
font-size: 28px;
cursor: pointer;
color: #666;
line-height: 1;
padding: 0 4px;
}
.modal-close:hover {
color: #333;
}
.modal-body {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
.modal-table-container {
flex: 1;
overflow: scroll;
padding: 0;
}
.transaction-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.transaction-table th,
.transaction-table td {
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid #eee;
white-space: nowrap;
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
}
.transaction-table th {
background-color: #f8f9fa;
font-weight: 600;
color: #555;
position: sticky;
top: 0;
z-index: 1;
}
.transaction-table tbody tr:hover {
background-color: #f5f8ff;
}
.transaction-table tbody tr:last-child td {
border-bottom: none;
}
/* Mobile modal styles */
@media (max-width: 850px) {
.modal-content {
width: 95vw;
height: 90vh;
}
.transaction-table {
font-size: 11px;
}
.transaction-table th,
.transaction-table td {
padding: 8px 10px;
max-width: 150px;
}
}
/* Row detail modal styles */
.row-detail-content {
position: relative;
width: 90vw;
max-width: 500px;
max-height: 80vh;
background-color: white;
border-radius: 12px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
padding: 24px;
overflow-y: auto;
}
.row-detail-content .modal-close {
position: absolute;
top: 12px;
right: 12px;
}
.row-detail-content h3 {
margin: 0 0 20px 0;
font-size: 18px;
color: #333;
padding-right: 30px;
}
#row-detail-body {
display: table;
width: 100%;
border-collapse: collapse;
}
.row-detail-item {
display: table-row;
}
.row-detail-item:hover {
background-color: #f8f9fa;
}
.row-detail-label {
display: table-cell;
padding: 8px 32px 8px 0;
font-size: 13px;
color: #999;
font-weight: 400;
white-space: nowrap;
vertical-align: top;
border-bottom: 1px solid #eee;
min-width: 140px;
}
.row-detail-value {
display: table-cell;
padding: 8px 0;
font-size: 13px;
color: #222;
font-weight: 600;
word-break: break-word;
border-bottom: 1px solid #eee;
}
.row-detail-item:last-child .row-detail-label,
.row-detail-item:last-child .row-detail-value {
border-bottom: none;
}
/* Sortable table header styles */
.transaction-table th {
cursor: pointer;
user-select: none;
position: relative;
padding-right: 20px !important;
}
.transaction-table th:hover {
background-color: #f0f0f0;
}
.transaction-table th::after {
content: '';
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
border: 4px solid transparent;
opacity: 0.3;
}
.transaction-table th.sort-asc::after {
border-bottom-color: #333;
border-top: none;
opacity: 1;
}
.transaction-table th.sort-desc::after {
border-top-color: #333;
border-bottom: none;
opacity: 1;
}
.transaction-table tbody tr {
cursor: pointer;
transition: background-color 0.15s;
}