/* =========================================================
   COWRY PORTAL REPORT CATALOGUE V5
   Clean replacement stylesheet for /CowryPortal/Reports.
   ========================================================= */

#ReportPage.cowry-report-page {
    --cowry-orange: #f89f40;
    --cowry-orange-dark: #c96c14;
    --cowry-red: #ed3237;
    --cowry-ink: #101828;
    --cowry-text: #344054;
    --cowry-muted: #667085;
    --cowry-border: #e4e7ec;
    --cowry-soft: #fff7ed;
    --cowry-canvas: #f7f9fc;

    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    color: var(--cowry-ink);
}

/* ---------- Header ---------- */

#ReportPage.cowry-report-page
.cowry-report-header {
    display: grid !important;
    grid-template-columns:
        minmax(420px, .95fr)
        minmax(380px, 1.05fr);
    align-items: center;
    gap: 20px;
    width: 100% !important;
    max-width: none !important;
    margin: 14px 0 16px !important;
}

#ReportPage.cowry-report-page
.cowry-report-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 76px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #f2d2ad;
    border-radius: 16px;
    background:
        linear-gradient(
            120deg,
            #fff8ef,
            #fff
        );
}

#ReportPage.cowry-report-page
.cowry-report-intro-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 12px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--cowry-orange),
            var(--cowry-red)
        );
}

#ReportPage.cowry-report-page
.cowry-report-intro-copy {
    min-width: 0;
}

#ReportPage.cowry-report-page
.cowry-report-intro strong {
    display: block;
    margin-bottom: 3px;
    color: var(--cowry-ink);
    font-size: 1.04rem;
    font-weight: 800;
}

#ReportPage.cowry-report-page
.cowry-report-intro span {
    display: block;
    color: var(--cowry-muted);
    font-size: .88rem;
    line-height: 1.45;
}

#ReportPage.cowry-report-page
.cowry-report-header
.s-QuickSearchBar {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

#ReportPage.cowry-report-page
.cowry-report-header
.s-QuickSearchInput {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px;
    font-size: .94rem;
}

/* ---------- Root report structure ---------- */

/*
 * IMPORTANT:
 * .report-list is the host/wrapper in this CowryPortal build.
 * Do not make the host a two-column grid.
 */
#ReportPage.cowry-report-page
.report-list.report-list-host {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: both !important;
}

/* The child UL is the real catalogue grid. */
#ReportPage.cowry-report-page
ul.root-report-list {
    display: grid !important;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        ) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 0 28px !important;
    padding: 0 !important;
    list-style: none !important;
    align-items: start;
}

/* ---------- Top-level categories ---------- */

#ReportPage.cowry-report-page
ul.root-report-list
> li.root-report-category {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 16px !important;
    list-style: none !important;
    border: 1px solid var(--cowry-border);
    border-top: 4px solid var(--cowry-orange);
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 7px 22px
        rgba(
            31,
            41,
            55,
            .055
        );
}

#ReportPage.cowry-report-page
ul.root-report-list
> li.root-report-category
> .line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 0 2px 12px;
    border-bottom:
        1px solid
        #eef1f4;
    color: var(--cowry-ink);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

#ReportPage.cowry-report-page
ul.root-report-list
> li.root-report-category
> .line::before {
    content: "\f080";
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border-radius: 10px;
    color: #b65d09;
    background: #fff0df;
    font-family:
        "Font Awesome 5 Free",
        FontAwesome;
    font-weight: 900;
}

#ReportPage.cowry-report-page
.report-category
> .line::after {
    content: "\f106";
    margin-left: auto;
    color: #98a2b3;
    font-family:
        "Font Awesome 5 Free",
        FontAwesome;
    font-weight: 900;
}

#ReportPage.cowry-report-page
.report-category:not(.expanded)
> .line::after {
    content: "\f107";
}

/* ---------- Lists inside categories ---------- */

#ReportPage.cowry-report-page
ul.root-report-list
> li.root-report-category
> ul {
    display: grid !important;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        ) !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ---------- Report cards ---------- */

#ReportPage.cowry-report-page
li.report-item {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: 0 !important;
    background: transparent !important;
}

#ReportPage.cowry-report-page
li.report-item
.report-link {
    position: relative;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 66px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding:
        .75rem
        2.45rem
        .75rem
        3.25rem;
    border:
        1px solid
        #e7e9ee;
    border-radius: 12px;
    color:
        var(--cowry-text)
        !important;
    background: #fff;
    box-shadow:
        0 3px 11px
        rgba(
            31,
            41,
            55,
            .035
        );
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.4;
    text-decoration:
        none !important;
    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

#ReportPage.cowry-report-page
li.report-item
.report-link::before {
    content: "\f15c";
    width: 31px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: .8rem;
    border-radius: 9px;
    color: #b45e0e;
    background:
        var(--cowry-soft);
    font-family:
        "Font Awesome 5 Free",
        FontAwesome;
    font-weight: 900;
}

#ReportPage.cowry-report-page
li.report-item
.report-link::after {
    content: "\f061";
    position: absolute;
    right: .85rem;
    color:
        var(--cowry-orange);
    font-family:
        "Font Awesome 5 Free",
        FontAwesome;
    font-weight: 900;
}

#ReportPage.cowry-report-page
li.report-item
.report-link:hover,
#ReportPage.cowry-report-page
li.report-item
.report-link:focus {
    transform:
        translateY(-2px);
    border-color:
        #f2bc81;
    box-shadow:
        0 9px 20px
        rgba(
            31,
            41,
            55,
            .09
        );
    color:
        #9b4c06
        !important;
}

/* ---------- Nested categories ---------- */

#ReportPage.cowry-report-page
ul.root-report-list
.report-category:not(
    .root-report-category
) {
    grid-column:
        1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin:
        8px 0 0 !important;
    padding:
        6px 0 0 !important;
    border: 0 !important;
    border-radius:
        0 !important;
    background:
        transparent !important;
    box-shadow:
        none !important;
    list-style:
        none !important;
}

  #ReportPage.cowry-report-page
  ul.root-report-list
  .report-category:not(.root-report-category) > .line {
    display: flex;
    align-items: center;
    margin: 0 0 6px;
    padding: 5px 3px 9px;
    border: 0;
    border-bottom: 1px solid #f4e8dc;
    color: #a65300;
    background: transparent;
    font-size: .80rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
    cursor: pointer;
  }

#ReportPage.cowry-report-page
ul.root-report-list
.report-category:not(
    .root-report-category
)
> ul {
    display: grid !important;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        ) !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ---------- Search behaviour ---------- */

#ReportPage.cowry-report-page
.non-match {
    display: none !important;
}

/* Respect Serenity's expanded/collapsed state. */
#ReportPage.cowry-report-page
.report-category:not(.expanded)
> ul {
    display: none !important;
}

#ReportPage.cowry-report-page
.report-category.expanded
> ul {
    display: grid !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    #ReportPage.cowry-report-page
    .cowry-report-header {
        grid-template-columns:
            1fr !important;
    }

    #ReportPage.cowry-report-page
    ul.root-report-list {
        grid-template-columns:
            1fr !important;
    }
}

@media (max-width: 720px) {
    #ReportPage.cowry-report-page
    ul.root-report-list
    > li.root-report-category
    > ul,
    #ReportPage.cowry-report-page
    ul.root-report-list
    .report-category:not(
        .root-report-category
    )
    > ul {
        grid-template-columns:
            1fr !important;
    }

    #ReportPage.cowry-report-page
    .cowry-report-intro {
        align-items: flex-start;
    }
}
