.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #2d2d2d;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    color: #e5e7eb;
    min-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.modal-content p {
    font-size: 1rem;
    margin-bottom: 20px;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}
.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-buttons .confirm {
    background: #3b82f6;
    color: #ffffff;
}
.modal-buttons .confirm:hover {
    background: #60a5fa;
}
.modal-buttons .cancel {
    background: #6b7280;
    color: #e5e7eb;
}
.modal-buttons .cancel:hover {
    background: #4b5563;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    text-align: left;
}
.password-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.password-form label {
    text-align: left;
    font-size: 0.95rem;
    color: #d1d5db;
}
.password-form input {
    padding: 10px;
    border: 1px solid #6b7280;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #3f3f3f;
    color: #e5e7eb;
    width: 100%;
}
.password-form input:focus {
    border-color: #60a5fa;
    outline: none;
}
.password-form .error {
    color: #f87171;
    font-size: 0.85rem;
    text-align: left;
    margin-top: 4px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
    background: #1a1a1a;
    color: #e5e7eb;
    overflow: hidden;
}
.dashboard {
    display: grid;
    grid-template-areas:
        "header header header"
        "left-panel map right-panel";
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr;
    height: 100vh;
    gap: 0;
    position: relative;
}
.header {
    grid-area: header;
    background: #2d2d2d;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1000;
    margin: 16px;
    gap: 16px;
}
.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #93c5fd;
    flex: 0 0 auto;
}
.header .reservoir-name {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 500;
    color: #bfdbfe;
    background: rgba(45, 45, 45, 0.8);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: auto;
}
.header .controls {
    display: flex;
    align-items: center;
    gap: 16px;
    width: auto;
    min-width: 0;
}
.header select,
.header button {
    padding: 10px 16px;
    border: 1px solid #6b7280;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #3f3f3f;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}
.header select:focus,
.header button:hover {
    border-color: #60a5fa;
    background: #4b5563;
}
.header button {
    background: #3b82f6;
    border: none;
    font-weight: 500;
}
.header button:hover {
    background: #60a5fa;
}
#userInfo {
    display: flex;
    flex-direction: column;
    text-align: right;
}
#userInfo span:first-child {
    font-size: 0.85rem;
    color: #9ca3af;
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease-out;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    margin-top: 16px;
    font-size: 1.2rem;
    color: #f3f4f6;
    font-weight: 500;
}
.panel#left-panel {
    grid-area: left-panel;
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
    min-width: 250px;
    height: 100%;
}
.panel#right-panel {
    grid-area: right-panel;
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
    min-width: 250px;
    height: 100%;
}
.resize-handle {
    display: none;
}
.panel-card {
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 16px;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #93c5fd;
    margin: 0;
    flex: 0 0 auto;
}
.panel-header select {
    width: auto;
    min-width: 100px;
    max-width: 200px;
    padding: 8px;
    border: 1px solid #6b7280;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #3f3f3f;
    color: #e5e7eb;
    transition: all 0.2s ease;
}
.panel-header select:focus {
    border-color: #60a5fa;
    background: #4b5563;
}
.panel-header #reset-t3d-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #6b7280;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.panel-header #reset-t3d-btn:hover {
    background: #4b5563;
}
.panel-header #reset-t3d-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}
.panel-header #reset-t3d-btn svg {
    width: 16px;
    height: 16px;
}
.panel-card ul {
    list-style: none;
}
.panel-card li {
    font-size: 0.95rem;
    color: #d1d5db;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}
.panel-card li span {
    font-weight: 500;
    color: #bfdbfe;
}
.panel-card select:not(.panel-header select) {
    width: 100%;
    padding: 10px;
    border: 1px solid #6b7280;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #3f3f3f;
    color: #e5e7eb;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
.panel-card select:not(.panel-header select):focus {
    border-color: #60a5fa;
    background: #4b5563;
}
#cesiumContainer {
    grid-area: map;
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    width: 100%;
}
#history-chart {
    flex: 1;
    width: 100%;
    min-height: 0;
}
#relational-chart, #t3d-chart {
    flex: 1;
    width: 100%;
}
.panel-header + div:not(.history-chart) {
    margin-top: 12px;
}
.range-slider {
    position: relative;
    height: 8px;
    background: #6b7280;
    border-radius: 4px;
    margin: 16px 0;
}
.slider-track {
    position: absolute;
    height: 100%;
    background: #60a5fa;
    border-radius: 4px;
}
.slider-range {
    position: absolute;
    height: 100%;
    background: #93c5fd;
    border-radius: 4px;
}
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: transparent;
    position: absolute;
    pointer-events: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 2px solid #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}
.date-controls-container {
    margin-top: 16px;
}
.date-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}
.date-inputs input {
    padding: 8px;
    border: 1px solid #6b7280;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #3f3f3f;
    color: #e5e7eb;
    flex: 1;
}
.help-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #60a5fa;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}
.help-panel {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: #2d2d2d;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    width: 220px;
}
.help-button:hover + .help-panel,
.help-panel:hover {
    display: block;
}
.help-panel p {
    font-size: 0.9rem;
    color: #d1d5db;
    margin-bottom: 8px;
}
.help-icon {
    width: 16px;
    vertical-align: middle;
    margin-right: 8px;
}
.keyboard-key {
    background: #6b7280;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e5e7eb;
}
.system-menu {
    position: relative;
    margin-left: 16px;
}
.system-menu button {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}
.system-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: #2d2d2d;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    z-index: 2000;
}
.system-menu-dropdown button {
    min-width: 100px;
    background: transparent;
    color: #e5e7eb;
    border: none;
    padding: 8px 16px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.system-menu-dropdown button:hover {
    background: #3f3f3f;
}
.hidden {
    display: none;
}
.no-data {
    display: none;
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: #9ca3af;
    background: #2d2d2d;
    border-radius: 6px;
}
.panel-card li span.nodata-text {
    color: #9ca3af;
    font-weight: 500;
}
@media (max-width: 1024px) {
    .dashboard {
        grid-template-areas:
            "header"
            "map";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .reservoir-name-container {
        top: 80px;
        width: calc(100% - 16px);
    }
    #cesiumContainer {
        height: 50vh;
    }
    .panel#left-panel, .panel#right-panel {
        display: none;
        height: auto;
        min-width: unset;
    }
}
@media (max-width: 768px) {
    .dashboard {
        padding: 8px;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
        margin: 8px;
    }
    .reservoir-name-container {
        top: 120px;
    }
    #cesiumContainer {
        height: 40vh;
    }
    .panel-card {
        padding: 12px;
    }
    .header {
        flex-direction: column;
        align-items: center;
    }
    .header h1,
    .header .controls {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .header .reservoir-name {
        position: static;
        transform: none;
        margin: 8px 0;
    }
    .panel-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .panel-header select {
        padding: 6px;
        font-size: 0.9rem;
        min-width: 80px;
        max-width: 150px;
    }
    .panel-header #reset-t3d-btn {
        width: 28px;
        height: 28px;
        padding: 0;
    }
    .panel-header #reset-t3d-btn svg {
        width: 14px;
        height: 14px;
    }
}
button.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}