* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6f8;
    color: #1a1a1a;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #16324f;
    color: #fff;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-title { font-weight: 600; font-size: 1.1rem; }

.site-header nav a {
    color: #cfe3ff;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.site-header nav a:hover { text-decoration: underline; }

.refresh-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1.5rem;
    background: #eef2f6;
    border-bottom: 1px solid #dde3e9;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #444;
}

.stale-banner {
    padding: 0.6rem 1.5rem;
    background: #fff3cd;
    color: #7a5c00;
    font-size: 0.85rem;
    border-bottom: 1px solid #f0dca0;
}

main {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.chart-wrap {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* The ported charts have a legend positioned outside the plot area (desktop
   layout). Below this width Plotly's responsive resize squeezes the legend
   into overlapping the chart, so we hold a minimum width and let the user
   scroll horizontally instead of rendering something visually broken. */
.chart-wrap > div {
    min-width: 1000px;
}

.chart-error {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    max-width: 420px;
    margin: 2rem auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-card form { display: flex; flex-direction: column; gap: 0.4rem; }

.login-card label { font-size: 0.85rem; font-weight: 600; margin-top: 0.6rem; }

.login-card input[type="text"],
.login-card input[type="password"] {
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.checkbox-label { display: flex; align-items: center; gap: 0.4rem; font-weight: normal; }

.btn-primary {
    margin-top: 1rem;
    padding: 0.7rem;
    background: #16324f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-primary:hover { background: #1e4569; }

.btn-small {
    padding: 0.4rem 0.9rem;
    background: #16324f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-small:hover { background: #1e4569; }
.btn-small:disabled { background: #888; cursor: default; }

.flashes { list-style: none; padding: 0; }

.flash {
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.flash-error { background: #fde2e1; color: #8b1a1a; }

@media (max-width: 480px) {
    .site-header { padding: 0.75rem 1rem; }
    .refresh-bar { padding: 0.5rem 1rem; }
    main { padding: 0 0.5rem; }
}
