/* AsthmaStats
   ------------------------------------------------------------------
   Green, amber and red are reserved exclusively for the peak flow
   action-plan zones. No other element in the interface may use them,
   so a colour in this palette always means what the user's own plan
   says it means. All zone colours meet WCAG AA against their paired
   background. */

:root {
    --as-navy: #1b4965;
    --as-navy-dark: #14384e;
    --as-cyan: #62b6cb;

    --zone-green: #15803d;
    --zone-green-bg: #dcfce7;
    --zone-amber: #b45309;
    --zone-amber-bg: #fef3c7;
    --zone-red: #b91c1c;
    --zone-red-bg: #fee2e2;
    --zone-none: #64748b;
    --zone-none-bg: #f1f5f9;

    --bs-primary: var(--as-navy);
}

body {
    font-feature-settings: "tnum" 1;
}

/* --------------------------------------------------------- branding */

.btn-primary {
    --bs-btn-bg: var(--as-navy);
    --bs-btn-border-color: var(--as-navy);
    --bs-btn-hover-bg: var(--as-navy-dark);
    --bs-btn-hover-border-color: var(--as-navy-dark);
    --bs-btn-active-bg: var(--as-navy-dark);
    --bs-btn-active-border-color: var(--as-navy-dark);
    --bs-btn-disabled-bg: var(--as-navy);
    --bs-btn-disabled-border-color: var(--as-navy);
}

.btn-outline-primary {
    --bs-btn-color: var(--as-navy);
    --bs-btn-border-color: var(--as-navy);
    --bs-btn-hover-bg: var(--as-navy);
    --bs-btn-hover-border-color: var(--as-navy);
    --bs-btn-active-bg: var(--as-navy);
    --bs-btn-active-border-color: var(--as-navy);
}

.navbar-brand,
.brand-mark {
    color: var(--as-navy);
}

a {
    color: var(--as-navy);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--as-cyan);
    box-shadow: 0 0 0 0.2rem rgba(98, 182, 203, 0.35);
}

.form-check-input:checked {
    background-color: var(--as-navy);
    border-color: var(--as-navy);
}

/* ------------------------------------------------- action plan zones */

.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
}

.zone-badge::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.zone-green { color: var(--zone-green); background-color: var(--zone-green-bg); }
.zone-amber { color: var(--zone-amber); background-color: var(--zone-amber-bg); }
.zone-red   { color: var(--zone-red);   background-color: var(--zone-red-bg); }
.zone-none  { color: var(--zone-none);  background-color: var(--zone-none-bg); }

.zone-hero {
    border-left: 6px solid currentColor;
}

/* ------------------------------------------------------ stat tiles */

.stat-tile {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.15rem;
    height: 100%;
    transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

a.stat-tile:hover {
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    text-decoration: none;
}

.stat-tile__label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.stat-tile__value {
    font-size: 1.85rem;
    font-weight: 650;
    line-height: 1.15;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.stat-tile__unit {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}

.stat-tile__meta {
    font-size: 0.8125rem;
    color: #64748b;
}

.stat-tile__swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
}

/* Trend arrows carry a text label for screen readers; the glyph alone
   never conveys meaning. */
.trend-up::before { content: "\2191"; }
.trend-down::before { content: "\2193"; }
.trend-flat::before { content: "\2192"; }

.trend {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

/* --------------------------------------------------------- charts */

.chart-shell {
    position: relative;
    width: 100%;
    height: 340px;
}

.chart-shell--tall {
    height: 420px;
}

.chart-shell--short {
    height: 190px;
}

/* ------------------------------------------------------ quick entry */

.metric-choice {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.metric-choice:hover {
    border-color: var(--as-navy);
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.08);
    color: inherit;
}

.metric-choice__dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-choice__name {
    font-weight: 600;
}

.metric-choice__unit {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Large touch targets: reliever and peak flow get logged one-handed,
   often mid-symptom. */
.quick-value-input {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.stepper-btn {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

/* --------------------------------------------------------- tables */

.table-readings td,
.table-readings th {
    vertical-align: middle;
}

.table-readings .value-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.tag-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    white-space: nowrap;
}

/* --------------------------------------------------------- print */

@media print {
    .navbar,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}
