/*!
 * TuneAfrique Console (user) theme.
 *
 * The artist, record label, aggregator, producer and sub-user dashboards all
 * share one set of sidebar classes (.dashboard-side-bar / .side-bar-menu /
 * .list_pad), so restyling them here reaches every role at once. Loaded after
 * dashboard.css so it wins without unpicking that file.
 *
 * Tokens are the same ones as sadmin_asset/css/console.css - the two consoles
 * are one product and should not drift. Contrast ratios in the comments are
 * measured against the surface each colour sits on.
 */

:root {
    /* Brand */
    --con-brand: #ff5722; /* rails and non-text accents only */
    --con-brand-strong: #cc3d10; /* 4.95:1 with white - filled buttons, links */
    --con-brand-glyph: #e8491d; /* 3.50:1 on --con-brand-tint */
    --con-brand-tint: #fff0ea;

    /* Sidebar */
    --con-nav-top: #3a2520;
    --con-nav-bottom: #2a1a16;
    --con-nav-idle: rgba(255, 255, 255, 0.72); /* 9.08:1 */
    --con-nav-heading: rgba(255, 255, 255, 0.52); /* 5.39:1 */
    --con-nav-active-bg: rgba(255, 87, 34, 0.18);
    --con-nav-active-icon: #ff8a5b; /* 5.58:1 on the active row */

    /* Ink & surfaces */
    --con-ink: #0b0b0b; /* 19.68:1 */
    --con-ink-2: #52514e; /* 7.94:1 */
    --con-ink-muted: #898781; /* 3.59:1 */
    --con-surface: #ffffff;
    --con-plane: #f7f6f3;
    --con-line: #e1e0d9;
}

/* ---------------------------------------------------------------- Sidebar */

/* The layouts each carry an inline `background: #67493f` on this element, and
   an inline style beats a class - hence !important here rather than a tidier
   rule. The inline attributes are removed from the blades too; this keeps the
   theme correct if one is missed. */
.dashboard-side-bar {
    background: linear-gradient(180deg, var(--con-nav-top) 0%, var(--con-nav-bottom) 100%) !important;
    border-right: 0;
}

.dashboard-side-bar .sidebar-brand {
    padding: 1.25rem 1rem 0.5rem;
}

/* The rl, agg and subuser layouts draw the brand as a background image in a
   fixed 85x57 box with no background-size, so anything larger than that box
   renders as a centre crop - a sliver of the artwork rather than the logo.
   `contain` fits whatever the source turns out to be. artist_wrapper and
   stream use an <img> and were never affected, which is why this only showed
   on those three. */
.dashboard-side-bar .logo-div {
    width: 85px;
    height: 51px;
    margin: 1.25rem auto 0.5rem;
    background-size: contain;
    background-position: center;
}

.side-bar-menu {
    padding-left: 0;
}

/* Below 700px dashboard.css turns the rail into an absolute overlay anchored at
   top: 0, while #nav is fixed at the same z-index - so the bar paints over the
   top of the menu and swallows the logo. Clearing the bar's height is safer
   than out-stacking it, which would put the menu over the toggle that closes
   it. 70px matches the bar's min-height set below. */
@media (max-width: 700px) {
    .dashboard-side-bar {
        padding-top: 70px;
    }
}

/* "MENU" - replaced by the per-section headings below. */
.side-bar-menu > h6 {
    display: none;
}

/* Section labels between menu groups. Mirrors .con-nav-heading in the admin
   console. Below 700px the rail becomes a narrow overlay where "Payments &
   Account" cannot wrap usefully, so the label collapses to a plain divider. */
/* Qualified with .unstyled li so it outranks that file's own
   `.unstyled li { font-size: 15px }`, which otherwise sizes these labels like
   menu rows. */
.side-bar-menu .unstyled li.con-nav-heading {
    height: 1px;
    margin: 0.75rem 1rem;
    padding: 0;
    font-size: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.14);
}

@media (min-width: 701px) {
    .side-bar-menu .unstyled li.con-nav-heading {
        height: auto;
        margin: 1.1rem 0 0.35rem;
        padding: 0 1.25rem;
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.09em;
        text-transform: uppercase;
        /* !important to clear `.unstyled li { color: #606060 !important }`, which
           otherwise paints these labels dark grey on the dark rail. */
        color: var(--con-nav-heading) !important;
        background: none;
    }

    .side-bar-menu .unstyled li.con-nav-heading:first-child {
        margin-top: 0.25rem;
    }
}

/* dashboard.css and ongoing.css both carry `.unstyled li { margin-block: 30px }`,
   which put 60px of margin around a 38px row - the menu read as a loose list of
   unrelated links rather than grouped navigation. */
.side-bar-menu .unstyled li {
    margin-block: 0;
    font-size: inherit;
    font-weight: inherit;
}

/* Reset the old right-hand rail and margin shuffle. dashboard.css moves the
   row 10px right on hover/active, which made the whole menu twitch as the
   pointer crossed it. */
.side-bar-menu .unstyled li.list_pad,
.list_pad,
.list_pad.active,
.list_pad:hover {
    margin-left: 0;
    padding-right: 0 !important;
    border: 0 !important;
    border-right: 0 !important;
    color: var(--con-nav-idle) !important;
}

.list_pad a,
.list_pad a:hover {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--con-nav-idle) !important;
    border-left: 3px solid transparent;
    /* The layouts put Bootstrap's .rounded on these links, and this build of
       admin/css/bootstrap.min.css redefines .rounded as `border-radius: 50rem
       !important` - a pill. Square rows, so the active rail reads as a rail. */
    border-radius: 0 !important;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.list_pad a i {
    flex: none;
    width: 1.25rem;
    margin-right: 0.75rem;
    font-size: 0.9375rem;
    text-align: center;
    color: inherit;
}

.list_pad a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
}

/* Active row: a left rail plus a tint, so the current page is legible without
   relying on the orange text that used to carry it at 3.1:1. */
.list_pad.active > a,
.list_pad.active > a:hover {
    color: #fff !important;
    background: var(--con-nav-active-bg);
    border-left-color: var(--con-brand);
    font-weight: 500;
}

.list_pad.active > a i {
    color: var(--con-nav-active-icon);
}

/* Logout sits apart from the navigation proper. */
.side-bar-menu .list_pad.con-nav-signout {
    margin-top: 0.75rem;
    padding-top: 0.75rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ----------------------------------------------------------------- Topbar */

/* dashboard.css pins #nav to height: 70px and gives it a peach wash with a
   drop shadow. The bar has to grow with the account block inside it, so the
   height becomes a floor rather than a fixed value. */
.dashboard-right > #nav {
    align-items: center;
    height: auto !important;
    min-height: 70px;
    background: var(--con-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--con-line);
}

/* #btg carries inline height: 70px and padding: 20px, so !important is the only
   way to stop it pinning the bar's height. No `display` here on purpose: the
   layouts hide this toggle above 700px with a plain `#btg { display: none }`,
   which anything more specific would silently undo. */
.dashboard-right #nav #btg {
    height: auto !important;
    padding: 12px 16px !important;
}

.dashboard-right #btg button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--con-ink-2) !important;
    background: var(--con-plane) !important;
    border: 1px solid var(--con-line) !important;
    border-radius: 9px !important;
}

.dashboard-right #btg button:hover {
    color: var(--con-brand-strong) !important;
    border-color: var(--con-brand) !important;
}

/* dashboard.css pins .user-avatar-div to 70px and .name-and-role to 40px, but
   .name-and-role is a flex column holding three stacked children - name,
   subscription pill, "User ID: n | Role" - that come to 58px, so the last line
   spilled past the bar's bottom border. Both boxes size to their content now. */
.dashboard-right #nav .user-avatar-div,
.dashboard-right #nav .user-avatar-div .name-and-role {
    height: auto;
}

.dashboard-right #nav .user-avatar-div {
    min-height: 56px;
    padding: 10px 20px;
}

.user-avatar-div .name-and-role h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--con-ink);
}

/* ------------------------------------------------------------------ Plane */

.dashboard-right {
    background: var(--con-plane);
}

/* ------------------------------------------------------- Dashboard metrics
 *
 * The artist, record label and aggregator dashboards all build their metric
 * tiles from .dashboard-card, so this reaches every one of them. The console's
 * card is a bordered plane rather than a drop shadow, with the number carrying
 * the weight instead of the label.
 */

.dashboard-card {
    height: auto;
    min-height: 104px;
    padding: 18px;
    padding-inline: 18px;
    gap: 14px;
    background: var(--con-surface);
    border: 1px solid var(--con-line);
    border-radius: 14px;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Several of these tiles are wrapped in a link. */
a:hover > .dashboard-card,
a:focus > .dashboard-card {
    border-color: var(--con-brand);
    box-shadow: 0 6px 18px rgba(11, 11, 11, 0.06);
}

.dashboard-card h6 {
    margin-bottom: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--con-ink-2);
}

/* The views set font-size and weight inline on the value, and .mt-3 pushes it a
   whole rem clear of its own label - hence !important on all three. The inline
   colour is deliberately left alone: these screens flip it between dark and
   orange to mark a hidden balance. */
.dashboard-card h3 {
    margin-top: 4px !important;
    margin-bottom: 0;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.15;
    letter-spacing: -0.02em;
    /* Deliberately not !important: the tiles that set a colour inline keep it,
       while the ones that do not - the upload count, which sits inside a link
       and so inherited link blue - pick up console ink. */
    color: var(--con-ink);
}

/* The tiles reuse .avatar for their icon, which rounds it to a circle at 40px
   and is then overridden to 56px inline. */
.dashboard-card img,
.dashboard-card img.avatar {
    flex: none;
    width: 44px !important;
    height: 44px !important;
    padding: 9px;
    background: var(--con-brand-tint);
    border-radius: 10px;
}
