* {
    margin: 2px;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .page {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #1f2937;
}

body.dark-mode .price-container {
    color: #e0e0e0;
}

body.dark-mode .chart-container {
    background-color: #5d5d5d;
    border-color: #404040;
}

body.dark-mode .settings-column h3 {
    color: #e0e0e0;
    border-bottom-color: #4a6fa5;
}

body.dark-mode .setting-group select,
body.dark-mode .setting-group input {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-mode .tariff-table th {
    background-color: #1f2937;
    color: #e0e0e0;
}

body.dark-mode .tariff-table td {
    border-color: #404040;
}

body.dark-mode .tariff-table input {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #404040;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1px;
}

/* Navbar — matches Nimbus */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #465a6c 0%, #3d5267 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.nav-title h1 {
    font-size: 24px;
    margin: 0;
}

.nav-subtitle {
    font-size: 14px;
    color: #bdc3c7;
    margin-top: 2px;
    font-weight: normal;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons:hover {
    background-color: white;
    color: #2c3e50;
    transform: rotate(45deg);
}

.action-buttons.active {
    background-color: white;
    color: #2c3e50;
}

/* Pages */
.page {
    display: none;
    background-color: white;
    border-radius: 8px;
    padding: 0px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page.active {
    display: block;
}

/* Price display */
.price-container {
    padding: 5px 15px;
    margin-bottom: 5px;
    background: linear-gradient(
        135deg,
        rgba(52, 73, 94, 0.55) 0%,
        rgba(44, 62, 80, 0.2) 100%
    );
    border-radius: 8px;
    color: #2c3e50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: center;
}

.price-value {
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
}

.price-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.zone-badge {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.8;
    justify-self: end;
}

@media (max-width: 768px) {
    .price-grid {
        grid-template-columns: 1fr 1fr auto;
        gap: 12px;
    }

    .price-value {
        font-size: 36px;
    }
}

/* Zoom menu */
.zoom-container {
    position: relative;
}

.zoom-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 2px solid #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

body.dark-mode .zoom-menu {
    background-color: #2d2d2d;
    border-color: #4a6fa5;
}

.zoom-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

body.dark-mode .zoom-option {
    color: #e0e0e0;
}

.zoom-option:hover {
    background-color: #f0f0f0;
}

body.dark-mode .zoom-option:hover {
    background-color: #3d3d3d;
}

/* Chart legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 0 0 4px 4px;
}

body.dark-mode .chart-legend {
    background-color: #2d2d2d;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    gap: 6px;
}

.legend-marker {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Chart */
.chart-container {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}

#elchart {
    height: 400px;
    max-height: calc(100vh - 300px);
}

@media (max-width: 768px) {
    #elchart {
        height: 350px;
        max-height: calc(100vh - 280px);
    }
}

@media (max-height: 700px) {
    #elchart {
        height: 300px;
        max-height: calc(100vh - 260px);
    }
}

/* Settings page */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-column h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.setting-group select,
.setting-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

@media (max-width: 500px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .settings-column h3 {
        font-size: 16px;
    }
}

/* Tariff table */
.tariff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.tariff-table th,
.tariff-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.tariff-table th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tariff-table input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.btn-delete {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    text-decoration: underline;
}

.settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.settings-actions button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 14px;
}

body.dark-mode .settings-actions button {
    background: #1f2937;
    border-color: #404040;
    color: #e0e0e0;
}

.settings-actions button:hover {
    background: #e0e0e0;
}

body.dark-mode .settings-actions button:hover {
    background: #2d3748;
}

.hidden {
    display: none !important;
}
