/*
 * InterLife admin theme, on top of django-unfold — copied from InterWaste so the
 * two portals look like one product. Keep the two copies in step.
 *
 * Unfold ships a precompiled Tailwind inside cascade layers, so every rule
 * here (unlayered) wins over it without !important. The flip side: Tailwind
 * utilities Unfold does not use itself do not exist, which is why the
 * dashboard and login are built from the iw-* components below instead.
 *
 * Colours come from Unfold's variables (set from settings.UNFOLD["COLORS"]),
 * so a palette change there flows through everything here.
 */

/* ── Fonts ─────────────────────────────────────────────────────────────── */

@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-500-latin-ext.b618fb2d9762.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-500-latin.c67b8cf83b8c.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-600-latin-ext.1e15ebe30c45.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-600-latin.965395aad327.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-700-latin-ext.ce737a669fce.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "IW Display";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-condensed/BarlowCondensed-700-latin.db3da8cffd10.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokens ────────────────────────────────────────────────────────────── */

:root {
    --iw-display: "IW Display", "Barlow Condensed", "Arial Narrow", sans-serif;

    /* The forest the sidebar, hero and login panel are painted in. */
    --iw-forest-700: oklch(32% .06 158);
    --iw-forest-800: oklch(25% .045 160);
    --iw-forest-900: oklch(20.5% .035 162);
    --iw-forest-950: oklch(16.5% .028 163);
    --iw-leaf: oklch(82% .17 150);

    --iw-surface: #fff;
    --iw-surface-2: var(--color-base-50);
    --iw-line: var(--color-base-200);
    --iw-text: var(--color-base-900);
    --iw-text-2: var(--color-base-600);
    --iw-text-3: var(--color-base-500);
    --iw-radius: 14px;
    --iw-shadow: 0 1px 2px oklch(20% .02 165 / .06), 0 1px 1px oklch(20% .02 165 / .04);
    --iw-shadow-lift: 0 10px 24px -12px oklch(20% .03 165 / .25), 0 2px 4px oklch(20% .02 165 / .06);

    /* Status tones: [text, background]. */
    --iw-success: oklch(45% .13 150);
    --iw-success-bg: oklch(95% .05 150);
    --iw-warning: oklch(50% .13 60);
    --iw-warning-bg: oklch(95.5% .06 85);
    --iw-danger: oklch(50% .19 27);
    --iw-danger-bg: oklch(95% .03 20);
    --iw-info: oklch(48% .15 255);
    --iw-info-bg: oklch(95% .03 250);
    --iw-neutral: var(--color-base-600);
    --iw-neutral-bg: var(--color-base-100);
    --iw-primary: var(--color-primary-700);
    --iw-primary-bg: var(--color-primary-100);
}

html.dark {
    --iw-surface: var(--color-base-900);
    --iw-surface-2: var(--color-base-950);
    --iw-line: var(--color-base-800);
    --iw-text: var(--color-base-100);
    --iw-text-2: var(--color-base-300);
    --iw-text-3: var(--color-base-400);
    --iw-shadow: none;
    --iw-shadow-lift: 0 10px 30px -14px oklch(0% 0 0 / .7);

    --iw-success: oklch(80% .15 150);
    --iw-success-bg: oklch(40% .08 150 / .35);
    --iw-warning: oklch(83% .13 80);
    --iw-warning-bg: oklch(45% .09 70 / .35);
    --iw-danger: oklch(78% .13 25);
    --iw-danger-bg: oklch(42% .12 25 / .35);
    --iw-info: oklch(80% .1 250);
    --iw-info-bg: oklch(42% .1 255 / .35);
    --iw-neutral: var(--color-base-300);
    --iw-neutral-bg: oklch(100% 0 0 / .07);
    --iw-primary: var(--color-primary-300);
    --iw-primary-bg: oklch(45% .1 150 / .35);
}

/* ── Global polish ─────────────────────────────────────────────────────── */

::selection {
    background: var(--color-primary-200);
    color: var(--color-primary-950);
}

:focus-visible {
    outline-color: var(--color-primary-600);
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Thin, quiet scrollbars instead of the platform's thick grey ones. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-base-300) transparent;
}
html.dark * {
    scrollbar-color: var(--color-base-700) transparent;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */

/*
 * In light mode the sidebar is painted in the brand's forest green. Unfold
 * draws it with base-* and font-* variables, so re-pointing those inside the
 * sidebar turns its light-on-white markup into light-on-dark without
 * touching the templates.
 */
html:not(.dark) #nav-sidebar {
    --color-base-50: var(--iw-forest-950);
    --color-base-100: oklch(100% 0 0 / .08);
    --color-base-200: oklch(100% 0 0 / .09);
    --color-base-300: oklch(100% 0 0 / .16);
    --color-base-400: oklch(76% .03 160);
    --color-base-500: oklch(72% .025 160);
    --color-base-600: oklch(84% .02 160);
    --color-base-700: oklch(92% .015 160);
    --color-base-800: oklch(94% .01 160);
    --color-base-900: oklch(97% .005 160);
    --color-white: oklch(100% 0 0 / .06);
    --color-font-subtle-light: oklch(72% .025 160);
    --color-font-default-light: oklch(87% .02 160);
    --color-font-important-light: oklch(98% .005 160);
    --color-primary-600: var(--iw-leaf);
    background:
        radial-gradient(120% 60% at 0% 0%, oklch(32% .07 155 / .55), transparent 60%),
        var(--iw-forest-950);
    border-right-color: transparent;
    color: var(--color-font-default-light);
}

html:not(.dark) #nav-sidebar #nav-sidebar-inner {
    background: transparent;
}

/* The user menu pops over the sidebar; give it a solid dark surface. */
html:not(.dark) #nav-sidebar nav.absolute {
    background: var(--iw-forest-800);
    border-color: oklch(100% 0 0 / .1);
}

html.dark #nav-sidebar {
    --color-base-900: oklch(17.5% .016 165);
}

#site-name {
    font-family: var(--iw-display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    text-transform: uppercase;
}

#nav-sidebar img[src$="icon.svg"] {
    border-radius: 10px;
    box-shadow: 0 0 0 1px oklch(100% 0 0 / .08), 0 6px 16px -6px oklch(60% .17 150 / .5);
}

/* Group titles: small caps-style labels rather than bold body text. */
#nav-sidebar-apps h2 {
    color: var(--color-font-subtle-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    margin-bottom: 0;
    text-transform: uppercase;
}
html.dark #nav-sidebar-apps h2 {
    color: var(--color-font-subtle-dark);
}

/* Active entry: a leaf-green bar on the left edge. */
#nav-sidebar-apps a.active {
    position: relative;
}
#nav-sidebar-apps a.active::before {
    background: var(--color-primary-600);
    border-radius: 0 3px 3px 0;
    content: "";
    height: 20px;
    left: 0;
    position: absolute;
    top: 9px;
    width: 3px;
}
html.dark #nav-sidebar-apps a.active::before {
    background: var(--color-primary-500);
}

/* Counters (templates/unfold/helpers/app_list_badge.html). */
.iw-nav-badge {
    border-radius: 999px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 18px;
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    text-align: center;
}
.iw-nav-badge--warning { background: oklch(80% .16 75); color: oklch(25% .06 60); }
.iw-nav-badge--info { background: oklch(72% .13 245); color: oklch(20% .05 250); }
.iw-nav-badge--success,
.iw-nav-badge--primary { background: var(--iw-leaf); color: var(--iw-forest-950); }
.iw-nav-badge--danger { background: oklch(66% .2 25); color: #fff; }

/* ── Page header & headings ────────────────────────────────────────────── */

#content h1,
.iw-display {
    font-family: var(--iw-display);
    letter-spacing: .01em;
}

/* ── Change lists ──────────────────────────────────────────────────────── */

#result_list thead th {
    color: var(--color-font-subtle-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
html.dark #result_list thead th {
    color: var(--color-font-subtle-dark);
}

#result_list tbody tr {
    transition: background-color .12s ease;
}
#result_list tbody tr:hover > td,
#result_list tbody tr:hover > th {
    background-color: color-mix(in oklch, var(--color-primary-500) 6%, transparent);
}

/* Two-line cells: a title and a quieter line under it (core.admin_ui.cell). */
.iw-cell {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}
.iw-cell__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.iw-cell__title,
.iw-cell__meta,
.iw-cell {
    white-space: nowrap;
}
.iw-cell__title {
    color: var(--color-font-important-light);
    font-weight: 600;
}
html.dark .iw-cell__title {
    color: var(--color-font-important-dark);
}
.iw-cell__meta {
    color: var(--color-font-subtle-light);
    font-size: 12px;
}
html.dark .iw-cell__meta {
    color: var(--color-font-subtle-dark);
}
.iw-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* ── Badges ────────────────────────────────────────────────────────────── */

.iw-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 600;
    gap: 5px;
    line-height: 1;
    padding: 4px 9px;
    white-space: nowrap;
}
.iw-badge::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 6px;
    width: 6px;
}
.iw-badge--plain::before { display: none; }
.iw-badge--success { background: var(--iw-success-bg); color: var(--iw-success); }
.iw-badge--warning { background: var(--iw-warning-bg); color: var(--iw-warning); }
.iw-badge--danger { background: var(--iw-danger-bg); color: var(--iw-danger); }
.iw-badge--info { background: var(--iw-info-bg); color: var(--iw-info); }
.iw-badge--neutral { background: var(--iw-neutral-bg); color: var(--iw-neutral); }
.iw-badge--primary { background: var(--iw-primary-bg); color: var(--iw-primary); }

.iw-tone--success { background: var(--iw-success-bg); color: var(--iw-success); }
.iw-tone--warning { background: var(--iw-warning-bg); color: var(--iw-warning); }
.iw-tone--danger { background: var(--iw-danger-bg); color: var(--iw-danger); }
.iw-tone--info { background: var(--iw-info-bg); color: var(--iw-info); }
.iw-tone--neutral { background: var(--iw-neutral-bg); color: var(--iw-neutral); }
.iw-tone--primary { background: var(--iw-primary-bg); color: var(--iw-primary); }

/* ── Avatars ───────────────────────────────────────────────────────────── */

.iw-avatar {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    flex: none;
    font-size: 12px;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    letter-spacing: .02em;
    width: 34px;
}
.iw-avatar--sm { font-size: 10.5px; height: 26px; width: 26px; }
.iw-avatar--0 { background: oklch(92% .06 150); color: oklch(35% .1 150); }
.iw-avatar--1 { background: oklch(92% .05 230); color: oklch(38% .1 240); }
.iw-avatar--2 { background: oklch(93% .06 80); color: oklch(42% .1 65); }
.iw-avatar--3 { background: oklch(92% .05 20); color: oklch(42% .13 25); }
.iw-avatar--4 { background: oklch(92% .05 300); color: oklch(40% .12 300); }
.iw-avatar--5 { background: oklch(92% .05 190); color: oklch(38% .08 195); }
.iw-avatar--6 { background: oklch(93% .05 120); color: oklch(40% .1 125); }
.iw-avatar--7 { background: oklch(92% .04 350); color: oklch(42% .12 355); }
html.dark .iw-avatar { filter: saturate(1.1) brightness(.92); }

/* ── Dashboard ─────────────────────────────────────────────────────────── */

.iw-dash {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 auto;
    max-width: 1440px;
}

.iw-card {
    background: var(--iw-surface);
    border: 1px solid var(--iw-line);
    border-radius: var(--iw-radius);
    box-shadow: var(--iw-shadow);
}

/* Hero */
.iw-hero {
    align-items: flex-end;
    background:
        radial-gradient(90% 140% at 100% 0%, oklch(40% .1 152 / .65), transparent 60%),
        linear-gradient(120deg, var(--iw-forest-800), var(--iw-forest-950));
    border-radius: calc(var(--iw-radius) + 4px);
    color: oklch(96% .01 160);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    isolation: isolate;
    justify-content: space-between;
    overflow: hidden;
    padding: 30px 32px;
    position: relative;
}
/* The login panel's route artwork, faded out before it reaches the text. */
.iw-hero::before {
    background: url("../brand/login-art.192e8f2e4cb2.svg") right -40px top 30% / 720px auto no-repeat;
    content: "";
    inset: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 75%);
    mask-image: linear-gradient(90deg, transparent 30%, #000 75%);
    opacity: .45;
    position: absolute;
    z-index: -1;
}
.iw-hero__eyebrow {
    align-items: center;
    color: oklch(82% .06 155);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    font-weight: 500;
    gap: 8px;
    letter-spacing: .02em;
}
.iw-hero__dot {
    background: var(--iw-leaf);
    border-radius: 50%;
    height: 4px;
    width: 4px;
}
.iw-hero__title {
    color: #fff;
    font-family: var(--iw-display);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 700;
    letter-spacing: .005em;
    line-height: 1.05;
    margin-top: 6px;
}
.iw-hero__summary {
    color: oklch(88% .03 158);
    font-size: 14px;
    margin-top: 8px;
    max-width: 62ch;
}
.iw-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.iw-chip {
    align-items: center;
    backdrop-filter: blur(6px);
    background: oklch(100% 0 0 / .08);
    border: 1px solid oklch(100% 0 0 / .16);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    padding: 8px 14px 8px 11px;
    transition: background-color .15s ease, transform .15s ease;
}
.iw-chip .material-symbols-outlined { font-size: 18px; }
.iw-chip:hover {
    background: oklch(100% 0 0 / .16);
    transform: translateY(-1px);
}
.iw-chip--solid {
    background: var(--iw-leaf);
    border-color: transparent;
    color: var(--iw-forest-950);
}
.iw-chip--solid:hover {
    background: oklch(88% .15 150);
}

/* KPI cards */
.iw-kpis {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.iw-kpi {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 16px;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.iw-kpi:hover {
    border-color: var(--color-primary-300);
    box-shadow: var(--iw-shadow-lift);
    transform: translateY(-2px);
}
html.dark .iw-kpi:hover {
    border-color: var(--color-primary-800);
}
.iw-kpi__head {
    align-items: center;
    display: flex;
    gap: 10px;
}
.iw-kpi__icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.iw-kpi__icon .material-symbols-outlined { font-size: 19px; }
.iw-kpi__label {
    color: var(--iw-text-2);
    font-size: 13px;
    font-weight: 600;
}
.iw-kpi__body {
    align-items: flex-end;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.iw-kpi__value {
    color: var(--iw-text);
    font-family: var(--iw-display);
    font-size: 46px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -.005em;
    line-height: .9;
}
.iw-kpi__foot {
    align-items: center;
    color: var(--iw-text-3);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 6px;
}

.iw-spark {
    flex: none;
    height: 36px;
    overflow: visible;
    width: 120px;
}
.iw-spark__line {
    fill: none;
    stroke: var(--color-primary-500);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.iw-spark__area {
    fill: color-mix(in oklch, var(--color-primary-500) 14%, transparent);
}

.iw-delta {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 2px;
    padding: 2px 7px 2px 5px;
}
.iw-delta .material-symbols-outlined { font-size: 15px; }
.iw-delta--up { background: var(--iw-success-bg); color: var(--iw-success); }
.iw-delta--down { background: var(--iw-danger-bg); color: var(--iw-danger); }

/* Panels */
.iw-grid {
    display: grid;
    gap: 20px;
}
@media (min-width: 1100px) {
    .iw-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
    .iw-grid--1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.iw-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px;
}
.iw-panel__head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.iw-panel__title {
    color: var(--iw-text);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.005em;
}
.iw-panel__sub {
    color: var(--iw-text-3);
    font-size: 12.5px;
    margin-top: 2px;
}

.iw-link {
    align-items: center;
    color: var(--color-primary-700);
    display: inline-flex;
    flex: none;
    font-size: 13px;
    font-weight: 600;
    gap: 2px;
}
.iw-link .material-symbols-outlined {
    font-size: 16px;
    transition: transform .15s ease;
}
.iw-link:hover .material-symbols-outlined { transform: translateX(2px); }
html.dark .iw-link { color: var(--color-primary-400); }

.iw-chart {
    position: relative;
}
.iw-chart--bar { height: 260px; }
.iw-chart--donut { height: 180px; }

/* Fleet condition */
.iw-stack {
    border-radius: 999px;
    display: flex;
    gap: 3px;
    height: 12px;
    overflow: hidden;
}
.iw-stack > span { min-width: 4px; }
.iw-stack__none { background: var(--color-base-200); }
html.dark .iw-stack__none { background: var(--color-base-700); }

.iw-classes {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.iw-classes__row {
    align-items: center;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 22px minmax(70px, auto) 1fr 36px;
    margin: 0 -8px;
    padding: 6px 8px;
    transition: background-color .12s ease;
}
.iw-classes__row:hover { background: var(--iw-surface-2); }
.iw-classes__swatch {
    border-radius: 6px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    height: 22px;
    line-height: 22px;
    text-align: center;
}
.iw-classes__label {
    color: var(--iw-text-2);
    font-size: 13px;
    font-weight: 500;
}
.iw-classes__bar {
    background: var(--color-base-100);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}
html.dark .iw-classes__bar { background: var(--color-base-800); }
.iw-classes__bar > span {
    border-radius: 999px;
    display: block;
    height: 100%;
}
.iw-classes__count {
    color: var(--iw-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.iw-note {
    align-items: center;
    color: var(--iw-text-3);
    display: inline-flex;
    font-size: 12.5px;
    gap: 6px;
    margin-top: auto;
}
.iw-note .material-symbols-outlined { font-size: 16px; }
a.iw-note:hover { color: var(--color-primary-700); }

/* Lists: routes and feeds */
.iw-list {
    display: flex;
    flex-direction: column;
}
.iw-list > li + li { border-top: 1px solid var(--iw-line); }

.iw-route,
.iw-feed {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    margin: 0 -10px;
    padding: 11px 10px;
    transition: background-color .12s ease;
}
.iw-route:hover,
.iw-feed:hover { background: var(--iw-surface-2); }

.iw-route__main,
.iw-feed__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.iw-route__top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}
.iw-route__name,
.iw-feed__title {
    color: var(--iw-text);
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.iw-feed__title { font-weight: 500; }
.iw-feed__title b { font-weight: 700; }
.iw-route__meta,
.iw-feed__meta {
    color: var(--iw-text-3);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.iw-route__count {
    color: var(--iw-text-3);
    flex: none;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: right;
}
.iw-route__count b {
    color: var(--iw-text);
    font-family: var(--iw-display);
    font-size: 20px;
    font-weight: 600;
}

.iw-progress {
    background: var(--color-base-100);
    border-radius: 999px;
    display: block;
    height: 5px;
    margin-top: 4px;
    overflow: hidden;
}
html.dark .iw-progress { background: var(--color-base-800); }
.iw-progress > span {
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400));
    border-radius: 999px;
    display: block;
    height: 100%;
    min-width: 5px;
}

.iw-feed__icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    flex: none;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.iw-feed__icon .material-symbols-outlined { font-size: 18px; }
.iw-feed__time {
    color: var(--iw-text-3);
    flex: none;
    font-size: 12px;
    min-width: 72px;
    text-align: right;
    white-space: nowrap;
}

.iw-empty {
    align-items: center;
    color: var(--iw-text-3);
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 160px;
    text-align: center;
}
.iw-empty .material-symbols-outlined {
    background: var(--iw-surface-2);
    border-radius: 50%;
    font-size: 24px;
    padding: 12px;
}
.iw-empty--good .material-symbols-outlined {
    background: var(--iw-success-bg);
    color: var(--iw-success);
}

/* Waste-stream legend */
.iw-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.iw-legend li {
    align-items: center;
    display: grid;
    font-size: 13px;
    gap: 10px;
    grid-template-columns: 10px 1fr auto 40px;
}
.iw-legend__swatch {
    border-radius: 3px;
    height: 10px;
    width: 10px;
}
.iw-legend__label { color: var(--iw-text-2); }
.iw-legend__value {
    color: var(--iw-text);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.iw-legend__pct {
    color: var(--iw-text-3);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ── Login and other signed-out pages ──────────────────────────────────── */

.iw-auth {
    background: var(--iw-surface);
    display: flex;
    min-height: 100vh;
}
.iw-auth__side {
    align-items: center;
    display: flex;
    flex: 1 1 46%;
    flex-direction: column;
    justify-content: center;
    padding: 72px 24px 32px;
    position: relative;
}
.iw-auth__form {
    max-width: 380px;
    width: 100%;
}
.iw-auth__foot {
    bottom: 22px;
    color: var(--iw-text-3);
    font-size: 12px;
    position: absolute;
}
.iw-auth__art {
    background-color: var(--iw-forest-950);
    background-position: center;
    background-size: cover;
    color: #fff;
    display: none;
    flex: 1 1 54%;
    padding: 56px;
    position: relative;
}
@media (min-width: 1024px) {
    .iw-auth__art {
        align-items: flex-end;
        display: flex;
    }
}
.iw-auth__copy {
    max-width: 520px;
    position: relative;
}
.iw-auth__eyebrow {
    align-items: center;
    color: oklch(88% .05 155);
    display: flex;
    font-family: var(--iw-display);
    font-size: 18px;
    font-weight: 700;
    gap: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.iw-auth__eyebrow img { border-radius: 8px; }
.iw-auth__headline {
    color: #fff;
    font-family: var(--iw-display);
    font-size: clamp(34px, 3.3vw, 52px);
    font-weight: 600;
    line-height: 1.02;
    margin-top: 18px;
}
.iw-auth__features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}
.iw-auth__features li {
    align-items: center;
    backdrop-filter: blur(6px);
    background: oklch(100% 0 0 / .07);
    border: 1px solid oklch(100% 0 0 / .14);
    border-radius: 999px;
    color: oklch(94% .02 155);
    display: inline-flex;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
    padding: 7px 13px 7px 10px;
}
.iw-auth__features .material-symbols-outlined {
    color: var(--iw-leaf);
    font-size: 17px;
}

.iw-auth-title {
    margin-bottom: 28px;
}
.iw-auth-title__icon {
    border-radius: 12px;
    box-shadow: 0 8px 20px -8px oklch(45% .15 150 / .6);
    margin-bottom: 22px;
}
.iw-auth-title__sub {
    color: var(--iw-text-3);
    font-size: 14px;
    font-weight: 500;
}
.iw-auth-title__title {
    color: var(--iw-text);
    font-family: var(--iw-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.05;
    text-transform: uppercase;
}

/* ── Narrow screens ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .iw-hero { padding: 22px 20px; }
    .iw-feed .iw-badge { display: none; }
    .iw-panel { padding: 18px 16px; }
}

/* ── InterLife only: "Sign in with InterWaste" and the near-end list ───── */

.iw-sso {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.iw-sso__button {
    align-items: center;
    background: var(--color-primary-600);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 15px;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    padding: 11px 16px;
    width: 100%;
}
.iw-sso__button:hover { background: var(--color-primary-700); }
.iw-sso__note {
    color: var(--iw-text-3);
    font-size: 13px;
}
.iw-sso__note a { color: var(--color-primary-600); text-decoration: underline; }
.iw-sso__message {
    background: var(--iw-danger-bg, oklch(95% .04 25));
    border-radius: 8px;
    color: var(--iw-danger, oklch(48% .17 25));
    font-size: 14px;
    padding: 12px 14px;
}
.iw-sso__divider {
    align-items: center;
    color: var(--iw-text-3);
    display: flex;
    font-size: 12px;
    gap: 10px;
    margin-top: 6px;
    text-transform: uppercase;
}
.iw-sso__divider::before,
.iw-sso__divider::after {
    border-top: 1px solid var(--iw-line);
    content: "";
    flex: 1;
}

.iw-near__pct {
    border-radius: 9999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 54px;
    padding: 2px 8px;
    text-align: center;
}
