/* =====================================================================
   MaterialManagement - the second layer: the searchable dropdown, the
   dashboard tiles, the charts and the soft lists.

   app.css sets the shell and the house style; this file holds the pieces
   that were added with the dashboard. Loaded after it.
   ===================================================================== */

/* ==================================================================
   SEARCHABLE DROPDOWN  (js/common/search-select.js)
   The native <select> keeps the value; this is what people see.
   ================================================================== */
.ss {
    position: relative;
    display: block;
}

/* A select the layout sized itself (w-auto) keeps that behaviour: the wrapper
   and the button both shrink to the label plus its chevron, so a "Rows" picker
   stays the size of "10" instead of reserving a field's worth of space. */
.ss.ss-auto {
    display: inline-block;
    width: auto;
}

    .ss.ss-auto .ss-toggle {
        width: auto;
        min-width: 76px;
    }

.ss-native {
    /* Kept in the DOM for its value and its events, but never shown. */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ss-toggle {
    width: 100%;
    text-align: left;
    background-color: #fff;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    transition: border-color .15s ease, box-shadow .15s ease;
    /* Bootstrap paints the chevron as a background image on the right. The
       house padding is symmetrical, which would run the label under it, so the
       right side gets its own room back. */
    padding-right: 2.3rem;
    background-position: right .85rem center;
}

    .ss-toggle.form-select-sm {
        padding-right: 2rem;
        background-position: right .65rem center;
    }

.ss.is-open .ss-toggle {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231b3a63' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 10 6-6 6 6'/%3e%3c/svg%3e");
}

    .ss-toggle.is-placeholder {
        color: var(--app-ink-mute);
        font-weight: 400;
    }

    .ss-toggle:disabled {
        background-color: #f4f6f9;
        cursor: not-allowed;
    }

.ss.is-open .ss-toggle {
    border-color: var(--app-brand);
    box-shadow: 0 0 0 .2rem rgba(27, 58, 99, .12);
}

.ss-menu {
    display: none;
    position: absolute;
    z-index: 1085;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: .85rem;
    box-shadow: 0 18px 44px rgba(16, 32, 46, .18);
    overflow: hidden;
    min-width: 200px;
}

.ss.is-open .ss-menu {
    display: block;
    animation: ssIn .13s ease;
}

/* A menu near the bottom of the window opens upward instead of off-screen. */
.ss.drop-up .ss-menu {
    top: auto;
    bottom: calc(100% + 5px);
}

@keyframes ssIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.ss-search {
    padding: 8px;
    border-bottom: 1px solid var(--app-line);
    background: #fbfcfe;
}

    .ss-search input {
        width: 100%;
        border: 1px solid #dde2ea;
        border-radius: .6rem;
        padding: .38rem .65rem;
        font-size: 13.5px;
        outline: none;
    }

        .ss-search input:focus {
            border-color: var(--app-brand);
            box-shadow: 0 0 0 .15rem rgba(27, 58, 99, .1);
        }

.ss-list {
    max-height: 244px;
    overflow-y: auto;
    padding: 5px;
}

.ss-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: .6rem;
    font-size: 14px;
    cursor: pointer;
    color: var(--app-ink);
}

    .ss-item.hi {
        background: var(--app-brand-soft);
    }

    .ss-item.is-selected {
        font-weight: 600;
        color: var(--app-brand);
    }

    .ss-item.is-disabled {
        opacity: .45;
        cursor: not-allowed;
    }

.ss-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--app-ink-mute);
}

/* ==================================================================
   DASHBOARD TILES - every one of them is a link into its own list
   ================================================================== */
.tile-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 4px;
}

@media (max-width: 1399.98px) {
    .tile-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767.98px) {
    .tile-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tile {
    position: relative;
    display: block;
    padding: 17px 18px 15px;
    background: var(--app-card);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    /* The tone bar is what tells the statuses apart at a glance. */
    .tile::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        background: var(--tone, var(--app-brand));
    }

    .tile:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 34px rgba(16, 32, 46, .13);
        border-color: #d6dce6;
        color: inherit;
    }

    .tile.is-loading {
        pointer-events: none;
        min-height: 118px;
    }

.tile-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: .7rem;
    background: var(--tone-soft, var(--app-brand-soft));
    color: var(--tone, var(--app-brand));
    margin-bottom: 11px;
}

.tile-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--app-ink-mute);
}

.tile-value {
    display: block;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 2px;
    color: var(--app-ink);
    letter-spacing: -.03em;
}

.tile-note {
    display: block;
    font-size: 11.5px;
    color: var(--app-ink-mute);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-go {
    position: absolute;
    top: 16px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f2f5f9;
    color: var(--tone, var(--app-brand));
    opacity: 0;
    transform: translateX(-4px);
    transition: .16s ease;
}

.tile:hover .tile-go {
    opacity: 1;
    transform: none;
}

.tile.tone-amber {
    --tone: #c2620f;
    --tone-soft: #fbeade;
}

.tile.tone-blue {
    --tone: #2f6fb0;
    --tone-soft: #e6f0fa;
}

.tile.tone-green {
    --tone: #1a7346;
    --tone-soft: #e3f3ea;
}

.tile.tone-grey {
    --tone: #6b7686;
    --tone-soft: #eef0f4;
}

.tile.tone-brand {
    --tone: #1b3a63;
    --tone-soft: #eaf0f8;
}

.tile.is-wide .tile-value {
    font-size: 24px;
}

/* ==================================================================
   CHARTS  (js/common/charts.js)
   ================================================================== */
.chart-box {
    width: 100%;
}

.chart-svg {
    width: 100%;
    height: 212px;
    overflow: visible;
}

.chart-donut-box {
    width: 100%;
    max-width: 214px;
}

.chart-donut {
    width: 100%;
    height: auto;
}

.donut-seg {
    transition: opacity .15s ease;
}

    .donut-seg.is-link {
        cursor: pointer;
    }

        .donut-seg.is-link:hover {
            opacity: .82;
        }

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 176px;
    color: var(--app-ink-mute);
    font-size: 13px;
    text-align: center;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: .6rem;
    text-decoration: none;
    color: inherit;
    font-size: 13.5px;
}

    .legend-row:hover {
        background: #f6f8fb;
        color: inherit;
    }

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.legend-label {
    flex: 1 1 auto;
}

.legend-value {
    font-weight: 700;
}

.legend-share {
    width: 42px;
    text-align: right;
    color: var(--app-ink-mute);
    font-size: 12px;
}

/* ranked bars ----------------------------------------------------- */
.ranked {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ranked-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    margin-bottom: 5px;
}

.ranked-label {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranked-value {
    font-weight: 700;
    white-space: nowrap;
    font-size: 13px;
}

.ranked-track {
    height: 7px;
    border-radius: 99px;
    background: #eef1f6;
    overflow: hidden;
}

.ranked-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--app-brand), #2f6fb0);
}

.ranked-sub {
    font-size: 11.5px;
    color: var(--app-ink-mute);
    margin-top: 4px;
}

/* ==================================================================
   SOFT LISTS - the recent and outstanding panels
   ================================================================== */
.soft-list {
    display: flex;
    flex-direction: column;
}

.soft-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #eef1f5;
    text-decoration: none;
    color: inherit;
    transition: background-color .12s ease;
}

    .soft-row:last-child {
        border-bottom: 0;
    }

    .soft-row:hover {
        background: #f7f9fc;
        color: inherit;
    }

.soft-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: .65rem;
    background: var(--app-brand-soft);
    color: var(--app-brand);
    flex: 0 0 auto;
}

.soft-main {
    flex: 1 1 auto;
    min-width: 0;
}

.soft-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soft-sub {
    display: block;
    font-size: 12px;
    color: var(--app-ink-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soft-end {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.soft-value {
    font-weight: 700;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

/* ==================================================================
   SEGMENTED CONTROL - the chart's metric switch
   ================================================================== */
.seg {
    display: inline-flex;
    background: #eef1f6;
    border-radius: .7rem;
    padding: 3px;
    gap: 2px;
}

    .seg button {
        border: 0;
        background: transparent;
        border-radius: .55rem;
        padding: .34rem .8rem;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--app-ink-soft);
        cursor: pointer;
        transition: .14s ease;
    }

        .seg button:hover {
            color: var(--app-ink);
        }

        .seg button.on {
            background: #fff;
            color: var(--app-brand);
            box-shadow: 0 1px 3px rgba(16, 32, 46, .12);
        }

/* ==================================================================
   POLISH - the rest of the shell, now that the type scale changed
   ================================================================== */
.app-sidebar .brand b {
    font-size: 15.5px;
    letter-spacing: -.02em;
}

.app-topbar .topbar-title {
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-size: 16.5px;
    letter-spacing: -.02em;
}

.page-head h1 {
    font-size: 28px;
    line-height: 1.15;
}

.page-head p {
    font-size: 14px;
    color: var(--app-ink-soft);
}

.card-header h5 {
    letter-spacing: -.02em;
}

.table thead th {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
}

.table tbody td {
    font-size: 14px;
}

.btn {
    letter-spacing: -.005em;
}

/* A card that only carries a list should not double its padding. */
.card-body.p-0 > .soft-list:first-child {
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    overflow: hidden;
}
