/* Dashboard, on top of the Django admin styles and the theme (theme.css): their colour
   variables also cover dark mode. */

/* Bars of the charts: one hue, a step per theme, at least 3:1 on the admin background. */
:root {
    --lpc-bar: #23589c;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --lpc-bar: #6fa6e8;
    }
}

html[data-theme="dark"] {
    --lpc-bar: #6fa6e8;
}

.lpc-dashboard #content-main {
    max-width: 1200px;
}

.lpc-alerts {
    background-color: var(--message-error-bg);
    border-left: 4px solid var(--error-fg);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.lpc-alerts h2 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--error-fg);
}

.lpc-alerts ul {
    margin: 0;
    padding-left: 18px;
}

.lpc-allgood {
    padding: 3px 12px;
    margin: 0;
    border-radius: 999px;
    background-color: var(--message-success-bg);
    font-weight: 700;
}

.lpc-allgood::before {
    content: "✓ ";
}

/* The zone, its sending day and the key figures */
.lpc-zone-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 4px 0 18px;
}

.lpc-zone-head h1,
#content .lpc-zone-head h1 {
    margin: 0;
}

.lpc-zone-head p {
    margin: 0;
}

.lpc-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.lpc-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background-color: var(--lpc-card);
    border: 1px solid var(--hairline-color);
    border-top: 4px solid var(--lpc-yellow);
    border-radius: 10px;
    box-shadow: var(--lpc-shadow);
}

a.lpc-tile:link,
a.lpc-tile:visited {
    color: var(--body-fg);
}

/* The admin underlines every link of the content: a:not(#header a, #content-main.app-list a…)
   weighs an id, a class and two elements. */
#content .lpc-tiles a.lpc-tile {
    text-decoration: none;
}

a.lpc-tile:hover {
    text-decoration: none;
    border-color: var(--border-color);
    border-top-color: var(--lpc-yellow);
}

.lpc-tile-label {
    color: var(--body-quiet-color);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.lpc-tile-value {
    font-family: var(--lpc-title-font);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--body-loud-color);
    font-variant-numeric: tabular-nums;
}

.lpc-tile-date {
    font-size: 1.25rem;
}

.lpc-tile-value small {
    font-family: var(--font-family-primary);
    font-size: 0.875rem;
    color: var(--body-quiet-color);
}

.lpc-tile-note {
    color: var(--body-quiet-color);
}

.lpc-tile-alert {
    border-top-color: var(--error-fg);
}

a.lpc-tile-alert:hover {
    border-top-color: var(--error-fg);
}

.lpc-tile-alert .lpc-tile-note {
    color: var(--error-fg);
    font-weight: 700;
}

.lpc-section {
    margin-bottom: 24px;
}

.lpc-section table {
    width: 100%;
}

.lpc-section td,
.lpc-section th {
    vertical-align: middle;
}

.lpc-scroll {
    overflow-x: auto;
}

.lpc-selected td {
    background-color: var(--selected-row);
}

.lpc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 24px;
    align-items: start;
}

.lpc-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.8125rem;
    background-color: var(--darkened-bg);
    border: 1px solid var(--hairline-color);
    white-space: nowrap;
}

.lpc-ok {
    background-color: var(--message-success-bg);
}

.lpc-failing {
    background-color: var(--message-error-bg);
    color: var(--error-fg);
    font-weight: 600;
}

.lpc-quiet {
    color: var(--body-quiet-color);
}

.lpc-error {
    color: var(--error-fg);
}

.lpc-note {
    padding: 8px 10px;
    margin: 0;
}

.lpc-inline-form {
    padding: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.lpc-emoji {
    font-size: 1.2em;
}

.lpc-apps h2 {
    font-size: 1rem;
    margin: 28px 0 10px;
    color: var(--body-loud-color);
}

.lpc-apps .module table {
    width: 100%;
}

/* Login page: the "Rester connecté" box, on one line with its label. */
.login .lpc-remember {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.login .lpc-remember label {
    display: inline;
    padding: 0;
}

.login .lpc-remember .help {
    flex-basis: 100%;
    margin: 0;
    padding: 0;
    color: var(--body-quiet-color);
}

/* Subscribers page */
.lpc-zone-filter {
    margin: 0 0 16px;
}

.lpc-total td {
    border-top: 2px solid var(--hairline-color);
    font-weight: 600;
}

.lpc-chart {
    margin: 0;
    padding: 8px 10px 0;
}

.lpc-chart figcaption {
    color: var(--body-quiet-color);
    margin-bottom: 4px;
}

.lpc-chart svg {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
}

.lpc-chart-axis {
    stroke: var(--hairline-color);
    stroke-width: 1;
}

.lpc-chart-bar {
    fill: var(--lpc-bar);
}

.lpc-chart-hit {
    fill: transparent;
}

.lpc-chart-week:hover .lpc-chart-hit {
    fill: var(--darkened-bg);
}

.lpc-chart-label,
.lpc-chart-value {
    fill: var(--body-quiet-color);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.lpc-chart-value {
    fill: var(--body-fg);
    font-weight: 600;
}

/* "Inviter un proche" page */
.lpc-invite {
    max-width: 720px;
}

.lpc-invite-form {
    padding: 0 10px 16px;
}

.lpc-invite-field {
    margin: 0 0 14px;
}

.lpc-invite-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.lpc-invite-field input,
.lpc-invite-field select,
.lpc-invite-field textarea {
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}

.lpc-invite-field p {
    margin: 4px 0 0;
}
