:root {
    --bg: #f5f7fb;
    --panel: #fff;
    --border: #e4e9f0;
    --text: #182230;
    --muted: #667085;
    --nav: #101828;
    --nav-hover: #1d2939;
    --blue: #3457d5;
    --green: #15803d;
    --green-soft: #ecfdf3;
    --red: #b42318;
    --red-soft: #fef3f2;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    padding: 24px 17px;
    background: var(--nav);
    color: #fff;
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    margin-bottom: 34px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--nav);
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #98a2b3;
    font-size: 10px;
}

.nav-label {
    margin: 0 10px 8px;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    padding: 10px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
}

.nav-item.active,
.nav-item:hover {
    background: var(--nav-hover);
    color: #fff;
}

.nav-box {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    font-size: 10px;
    font-weight: 800;
}

.nav-subitem {
    display: block;
    margin: 2px 0 9px 43px;
    padding: 7px 9px;
    border-radius: 6px;
    color: #98a2b3;
    text-decoration: none;
    font-size: 10px;
}

.nav-subitem.active,
.nav-subitem:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar-footer {
    position: absolute;
    bottom: 24px;
    left: 25px;
    color: #98a2b3;
    font-size: 10px;
}

.online-dot,
.green-dot,
.amber-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
}

.online-dot,
.green-dot {
    background: #22c55e;
}

.amber-dot {
    background: #f59e0b;
}

.main {
    margin-left: 245px;
}

.page {
    max-width: 1580px;
    margin: auto;
    padding: 34px 36px 60px;
}

.wide-page {
    max-width: 1800px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.eyebrow {
    color: var(--blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

h1 {
    margin: 5px 0 0;
    font-size: 28px;
}

.page-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.source-mode {
    height: fit-content;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 10px;
}

.breadcrumb {
    display: flex;
    gap: 7px;
    margin-bottom: 13px;
    color: #98a2b3;
    font-size: 10px;
}

.breadcrumb a {
    color: var(--blue);
    text-decoration: none;
}

.header-actions,
.action-row {
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.metric-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0,1fr));
    gap: 13px;
    margin-bottom: 16px;
}

.metric-grid-five {
    grid-template-columns:
        repeat(5, minmax(0,1fr));
}

.metric-card {
    min-height: 100px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
}

.metric-card span {
    color: var(--muted);
    font-size: 10px;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 25px;
}

.metric-card strong.good {
    color: var(--green);
}

.metric-card .metric-small {
    font-size: 12px;
    line-height: 1.5;
}

.metric-card .metric-text {
    font-size: 15px;
}

.panel {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 14px;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
    vertical-align: middle;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
}

.badge.success {
    background: var(--green-soft);
    color: var(--green);
}

.badge.danger {
    background: var(--red-soft);
    color: var(--red);
}

.badge.neutral {
    background: #f2f4f7;
    color: #667085;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid #d8dee8;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    text-decoration: none;
    font-size: 9px;
    font-weight: 700;
}

.button.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.button.danger-outline {
    border-color: #fecaca;
    color: var(--red);
}

.billing-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-grid {
    display: grid;
    grid-template-columns:
        .8fr 1.2fr 1.5fr;
}

.control-block {
    padding: 18px;
    border-right: 1px solid var(--border);
}

.control-block:last-child {
    border-right: 0;
}

.control-title {
    font-size: 11px;
    font-weight: 750;
}

.control-description {
    min-height: 35px;
    color: var(--muted);
    font-size: 9px;
}

.upload-row,
.schedule-row {
    display: flex;
    gap: 7px;
    align-items: center;
}

input {
    min-height: 31px;
    padding: 5px 8px;
    border: 1px solid #d8dee8;
    border-radius: 7px;
    font-size: 9px;
}

input[type=file] {
    max-width: 220px;
}

.cron-input {
    width: 120px;
    font-family: monospace;
}

.toggle-label {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 9px;
}

.toggle-label input {
    min-height: auto;
}

.next-run,
.subtext {
    margin-top: 5px;
    color: #98a2b3;
    font-size: 8px;
}

.alert {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 11px;
}

.alert-success {
    border: 1px solid #bbf7d0;
    background: var(--green-soft);
    color: var(--green);
}

.alert-error {
    border: 1px solid #fecaca;
    background: var(--red-soft);
    color: var(--red);
}

.error-cell {
    max-width: 420px;
    overflow: hidden;
    color: var(--red);
    text-overflow: ellipsis;
}

.placeholder-panel {
    min-height: 260px;
    padding: 70px;
    text-align: center;
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 800;
}

@media (max-width: 1100px) {

    .metric-grid-five {
        grid-template-columns:
            repeat(3,1fr);
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .control-block {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 760px) {

    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
    }

    .page {
        padding: 20px 14px;
    }
}


/* =====================================================================
   FC MASTER FILTER / SORT V1
   ===================================================================== */

.table-filter-panel {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.8fr)
        repeat(7, minmax(100px, .7fr))
        auto;
    gap: 9px;
    align-items: end;
    padding: 13px 15px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}


.table-search,
.filter-field {
    min-width: 0;
}


.table-search label,
.filter-field label {
    display: block;
    margin-bottom: 5px;
    color: #667085;
    font-size: 8px;
    font-weight: 700;
}


.table-search input,
.filter-field select {
    width: 100%;
    min-height: 32px;
    border: 1px solid #d8dee8;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    font-size: 9px;
}


.table-search input {
    padding: 6px 9px;
}


.filter-field select {
    padding: 5px 7px;
}


.filter-reset {
    display: flex;
    align-items: flex-end;
}


.table-count {
    color: #667085;
    font-size: 9px;
}


.table-count strong {
    color: #182230;
}


.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition:
        background .12s ease,
        color .12s ease;
}


.sortable-table th.sortable:hover {
    background: #f1f4f8;
    color: #344054;
}


.sortable-table th.sort-active {
    background: #eef2ff;
    color: #3457d5;
}


.sort-icon {
    display: inline-block;
    min-width: 12px;
    margin-left: 4px;
    color: #98a2b3;
    font-size: 10px;
}


.sort-active .sort-icon {
    color: #3457d5;
}


.filter-no-results td {
    padding: 34px 20px;
    color: #667085;
    text-align: center;
}


@media (
    max-width: 1500px
) {

    .table-filter-panel {
        grid-template-columns:
            minmax(220px, 2fr)
            repeat(4, minmax(110px, 1fr));
    }

}


@media (
    max-width: 950px
) {

    .table-filter-panel {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .table-search {
        grid-column:
            1 / -1;
    }

}


@media (
    max-width: 560px
) {

    .table-filter-panel {
        grid-template-columns:
            1fr;
    }

    .table-search {
        grid-column:
            auto;
    }

}

/* =====================================================================
   END FC MASTER FILTER / SORT V1
   ===================================================================== */


/* =====================================================================
   FC BILLING AJAX V1
   ===================================================================== */

.billing-form button:disabled {
    opacity: .55;
    cursor: wait;
}


.billing-ajax-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    max-width: 360px;

    padding: 11px 15px;

    border-radius: 9px;

    box-shadow:
        0 8px 28px
        rgba(16, 24, 40, .18);

    font-size: 10px;
    font-weight: 700;

    opacity: 0;
    transform:
        translateY(
            12px
        );

    pointer-events: none;

    transition:
        opacity .18s ease,
        transform .18s ease;
}


.billing-ajax-toast.show {
    opacity: 1;

    transform:
        translateY(
            0
        );
}


.billing-ajax-toast.success {
    border:
        1px solid
        #bbf7d0;

    background:
        #ecfdf3;

    color:
        #15803d;
}


.billing-ajax-toast.error {
    border:
        1px solid
        #fecaca;

    background:
        #fef3f2;

    color:
        #b42318;
}

/* =====================================================================
   END FC BILLING AJAX V1
   ===================================================================== */


/* =====================================================================
   FC BILLING AJAX V3
   ===================================================================== */

.billing-form button:disabled {
    opacity: .55;
    cursor: wait;
}


.billing-ajax-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;

    max-width: 380px;

    padding: 11px 15px;

    border-radius: 9px;

    box-shadow:
        0 8px 28px
        rgba(16, 24, 40, .18);

    font-size: 10px;
    font-weight: 700;

    opacity: 0;

    transform:
        translateY(
            12px
        );

    pointer-events: none;

    transition:
        opacity .16s ease,
        transform .16s ease;
}


.billing-ajax-toast.show {
    opacity: 1;

    transform:
        translateY(
            0
        );
}


.billing-ajax-toast.success {
    border: 1px solid #bbf7d0;
    background: #ecfdf3;
    color: #15803d;
}


.billing-ajax-toast.error {
    border: 1px solid #fecaca;
    background: #fef3f2;
    color: #b42318;
}

/* =====================================================================
   END FC BILLING AJAX V3
   ===================================================================== */


/* =====================================================================
   FC MASTER MULTI-SELECT FILTER V2
   ===================================================================== */

.multi-filter {
    position: relative;
    min-width: 0;
}


.multi-filter > label {
    display: block;
    margin-bottom: 5px;

    color: #667085;

    font-size: 8px;
    font-weight: 700;
}


.multi-filter-button {
    width: 100%;
    min-height: 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;

    padding: 5px 8px;

    border: 1px solid #d8dee8;
    border-radius: 7px;

    background: #fff;
    color: #344054;

    cursor: pointer;

    font-size: 9px;
    text-align: left;
}


.multi-filter-button:hover {
    border-color: #b9c2cf;
    background: #fdfefe;
}


.multi-filter.has-selection
.multi-filter-button {
    border-color: #9dafef;
    background: #f7f8ff;
    color: #2949bd;
}


.multi-filter-text {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.multi-filter-arrow {
    flex: 0 0 auto;

    color: #98a2b3;

    transition:
        transform .15s ease;
}


.multi-filter.open
.multi-filter-arrow {
    transform:
        rotate(
            180deg
        );
}


.multi-filter-menu {
    position: absolute;

    top: calc(100% + 5px);
    left: 0;

    z-index: 1000;

    display: none;

    width: max(100%, 190px);
    max-width: 280px;

    overflow: hidden;

    border: 1px solid #d8dee8;
    border-radius: 9px;

    background: #fff;

    box-shadow:
        0 10px 30px
        rgba(16, 24, 40, .14);
}


.multi-filter.open
.multi-filter-menu {
    display: block;
}


.multi-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 7px 9px;

    border-bottom:
        1px solid
        #eef1f5;

    background:
        #fafbfc;
}


.multi-filter-actions button {
    padding: 0;

    border: 0;

    background:
        transparent;

    color:
        #3457d5;

    cursor:
        pointer;

    font-size:
        8px;

    font-weight:
        700;
}


.multi-filter-options {
    max-height: 240px;

    overflow-y: auto;

    overscroll-behavior:
        contain;

    padding: 5px;
}


.multi-filter-option {
    display: flex;
    align-items: center;
    gap: 7px;

    min-height: 31px;

    padding: 5px 7px;

    border-radius: 6px;

    color: #344054;

    cursor: pointer;

    font-size: 9px;
}


.multi-filter-option:hover {
    background:
        #f5f7fb;
}


.multi-filter-option input {
    width: 14px;
    height: 14px;
    min-height: 0;

    margin: 0;

    cursor: pointer;

    accent-color:
        #3457d5;
}


.multi-filter-option span {
    overflow: hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


/*
 * The dropdown must escape the FC data panel.
 */
.wide-page > .panel {
    overflow: visible;
}


.table-filter-panel {
    position: relative;
    z-index: 20;

    overflow: visible;
}


.table-scroll {
    position: relative;
    z-index: 1;

    overflow-x: auto;
}


@media (
    max-width: 950px
) {

    .multi-filter-menu {
        width: 100%;
        max-width: none;
    }
}

/* =====================================================================
   END FC MASTER MULTI-SELECT FILTER V2
   ===================================================================== */


/* =====================================================================
   PLANNED DRR FILTER GRID
   ===================================================================== */

.planned-drr-filter-grid {
    display: grid;

    grid-template-columns:
        minmax(260px, 2fr)
        repeat(4, minmax(130px, 1fr))
        auto;

    gap: 9px;

    align-items: end;

    padding: 13px 15px;

    border-bottom:
        1px solid
        var(--border);

    background:
        #fafbfc;
}


@media (
    max-width: 1200px
) {

    .planned-drr-filter-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }


    .planned-drr-filter-grid
    .table-search {
        grid-column:
            1 / -1;
    }
}


@media (
    max-width: 700px
) {

    .planned-drr-filter-grid {
        grid-template-columns:
            1fr;
    }


    .planned-drr-filter-grid
    .table-search {
        grid-column:
            auto;
    }
}

/* =====================================================================
   END PLANNED DRR FILTER GRID
   ===================================================================== */


/* =====================================================================
   PRIORITY SKU FILTER GRID
   ===================================================================== */

.priority-filter-grid {
    display: grid;

    grid-template-columns:
        minmax(280px, 2fr)
        repeat(3, minmax(150px, 1fr))
        auto;

    gap: 9px;

    align-items: end;

    padding: 13px 15px;

    border-bottom:
        1px solid
        var(--border);

    background:
        #fafbfc;
}


.remarks-cell {
    max-width: 500px;

    overflow: hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


@media (
    max-width: 1050px
) {

    .priority-filter-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .priority-filter-grid
    .table-search {
        grid-column:
            1 / -1;
    }
}


@media (
    max-width: 650px
) {

    .priority-filter-grid {
        grid-template-columns:
            1fr;
    }


    .priority-filter-grid
    .table-search {
        grid-column:
            auto;
    }
}

/* =====================================================================
   END PRIORITY SKU FILTER GRID
   ===================================================================== */
