/*
 * Brand theme layered over the Skydash template.
 * Colours come from the --b-* variables set in partials/brand-head, which are
 * derived from config/brand.php. Do not hardcode brand colours here.
 */

:root {
    --primary: var(--b-600);
}

/* ---------- Controls ---------- */

body .btn-primary {
    color: #fff;
    background-color: var(--b-600);
    border-color: var(--b-600);
}

body .btn-primary:hover,
body .btn-primary:focus,
body .btn-primary:not(:disabled):not(.disabled):active,
body .show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--b-700);
    border-color: var(--b-700);
}

body .btn-outline-primary {
    color: var(--b-700);
    border-color: var(--b-600);
}

body .btn-outline-primary:hover,
body .btn-outline-primary:not(:disabled):not(.disabled):active {
    color: #fff;
    background-color: var(--b-600);
    border-color: var(--b-600);
}

body .btn:focus-visible {
    box-shadow: 0 0 0 3px var(--b-200);
}

body .form-control:focus,
body .custom-select:focus,
body select:focus {
    border-color: var(--b-500);
    box-shadow: 0 0 0 3px var(--b-100);
    outline: none;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--b-600);
}

body .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--b-600);
    border-color: var(--b-600);
}

body .text-primary {
    color: var(--b-600) !important;
}

body .bg-primary,
body .badge-primary {
    background-color: var(--b-600) !important;
}

body .border-primary {
    border-color: var(--b-600) !important;
}

body .page-link {
    color: var(--b-700);
}

body .page-item.active .page-link {
    color: #fff;
    background-color: var(--b-600);
    border-color: var(--b-600);
}

body .dropdown-item.active,
body .dropdown-item:active {
    color: #fff;
    background-color: var(--b-600);
}

body .nav-pills .nav-link.active {
    background-color: var(--b-600);
}

body .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--b-600);
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--b-50);
    border-color: var(--b-300);
    color: var(--b-900);
}

body .swal2-popup .swal2-styled.swal2-confirm {
    background-color: var(--b-600);
}

/* ---------- Application shell ---------- */

.brand-shell,
.brand-shell .page-body-wrapper {
    background: var(--b-ink);
}

/* Beats page-level styles that give the panel a light background. */
.brand-shell .main-panel {
    background: var(--b-ink);
}

.brand-shell .main-panel .content-wrapper {
    background: radial-gradient(ellipse at top right, var(--b-900), transparent 55%), var(--b-ink);
}

.brand-shell .content-wrapper .card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.brand-shell .content-wrapper a:not([class]) {
    color: var(--b-700);
}

.brand-shell .table thead th {
    background-color: var(--b-800);
    border-color: var(--b-700);
    color: #fff;
}

.brand-shell .table-hover tbody tr:hover {
    background-color: var(--b-50);
}

.principal-active {
    background: linear-gradient(90deg, var(--b-600), var(--b-800));
    color: #fff;
}

.no-underline,
.no-underline:hover {
    text-decoration: none;
}

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

.brand-shell .navbar.brand-header {
    background: var(--b-ink);
    box-shadow: none;
    z-index: 1030;
}

.brand-shell .navbar.brand-header .navbar-brand-wrapper {
    background: var(--b-950);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 60px;
}

.brand-shell .navbar.brand-header .navbar-brand-wrapper .navbar-brand img {
    width: auto;
    max-width: 100%;
    height: 38px;
    margin: 0;
    object-fit: contain;
}

.brand-shell .navbar.brand-header .navbar-brand-wrapper .brand-logo-mini {
    display: none;
}

.brand-shell .navbar.brand-header .navbar-menu-wrapper {
    background: var(--b-ink);
    border-top: 2px solid var(--b-500);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
    color: #fff;
    height: 60px;
    padding-left: 12px;
    padding-right: 20px;
    justify-content: flex-start;
}

.brand-shell .navbar.brand-header .navbar-toggler {
    display: block;
    border: 0;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.75);
}

.brand-shell .navbar.brand-header .navbar-toggler:hover {
    color: #fff;
}

.brand-shell .navbar.brand-header .navbar-toggler .icon-menu {
    color: inherit;
    font-size: 1.1rem;
}

.brand-product {
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.brand-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.brand-bell {
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15rem;
    line-height: 1;
}

.brand-bell:hover {
    color: #fff;
    text-decoration: none;
}

.brand-bell .brand-count {
    position: absolute;
    top: -9px;
    right: -10px;
    min-width: 18px;
    padding: 2px 5px;
    border-radius: 999px;
    background: var(--b-500);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

.brand-avatar img {
    width: 34px;
    height: 34px;
    border: 2px solid var(--b-400);
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
}

.brand-logout {
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.brand-logout:hover {
    border-color: var(--b-400);
    background: var(--b-700);
    color: #fff;
}

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

.brand-shell .sidebar.brand-sidebar {
    background: linear-gradient(180deg, var(--b-950), var(--b-ink) 85%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 12px;
}

.bs-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bs-role {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--b-700);
    color: var(--b-50);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bs-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.bs-menu,
.bs-sub {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bs-item {
    position: relative;
    margin-bottom: 3px;
}

.brand-sidebar .bs-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-left: 4px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.brand-sidebar .bs-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.brand-sidebar .bs-link.is-open {
    background: rgba(255, 255, 255, 0.05);
    color: var(--b-100);
}

.brand-sidebar .bs-link.is-active {
    border-left-color: var(--b-300);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.bs-icon {
    width: 20px;
    flex: 0 0 20px;
    font-size: 1rem;
    text-align: center;
}

.bs-label {
    flex: 1;
}

.bs-caret {
    transition: transform 0.2s;
}

.bs-caret::before {
    content: "\203A";
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
}

.bs-link[aria-expanded="true"] .bs-caret {
    transform: rotate(90deg);
}

.bs-sub {
    margin: 4px 0 6px 21px;
    padding-left: 9px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-sidebar .bs-sub .bs-link {
    padding: 7px 10px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.brand-sidebar .close-sidebar {
    display: none;
}

/* Desktop: the header toggle shrinks the sidebar to an icon rail. */
@media (min-width: 992px) {
    .brand-shell.sidebar-icon-only .navbar.brand-header .navbar-brand-wrapper .brand-logo {
        display: none;
    }

    .brand-shell.sidebar-icon-only .navbar.brand-header .navbar-brand-wrapper .brand-logo-mini {
        display: block;
    }

    .brand-shell.sidebar-icon-only .sidebar.brand-sidebar {
        width: 70px;
        padding: 14px 8px;
    }

    .sidebar-icon-only .bs-head,
    .sidebar-icon-only .brand-sidebar .bs-item > .bs-link > .bs-label,
    .sidebar-icon-only .bs-caret,
    .sidebar-icon-only .brand-sidebar .collapse,
    .sidebar-icon-only .brand-sidebar .collapsing {
        display: none;
    }

    .sidebar-icon-only .brand-sidebar .bs-item:hover > .collapse {
        display: block;
        position: absolute;
        top: 0;
        left: 100%;
        z-index: 1050;
        min-width: 210px;
        padding: 4px 10px 1px;
        border-radius: 0 10px 10px 0;
        background: var(--b-950);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
}

/* Tablet and phone: the sidebar slides in over the page. */
@media (max-width: 991.98px) {
    .brand-shell .sidebar.brand-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        z-index: 1040;
        width: 250px;
        height: 100vh;
        overflow-y: auto;
        padding-top: 60px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .brand-shell .sidebar.brand-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
    }

    .brand-shell .sidebar.brand-sidebar .close-sidebar {
        display: flex;
        position: absolute;
        top: 14px;
        right: 12px;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .brand-shell .navbar.brand-header .navbar-brand-wrapper {
        width: 150px;
        padding: 0 10px;
    }

    .brand-shell .navbar.brand-header .navbar-brand-wrapper .brand-logo {
        display: block;
    }

    .brand-shell .navbar.brand-header .navbar-menu-wrapper {
        width: calc(100% - 150px);
        padding-right: 12px;
    }

    .brand-product {
        display: none;
    }

    .brand-actions {
        gap: 12px;
    }

    .brand-logout {
        padding: 4px 10px;
    }
}

/* ---------- Footer ---------- */

.brand-shell .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: var(--b-ink);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.brand-shell .footer img {
    width: auto;
    height: 26px;
    opacity: 0.85;
}

.brand-shell .footer p {
    margin: 0;
}

.brand-shell .footer a {
    color: rgba(255, 255, 255, 0.75);
}

/* ---------- Sign-in and password screens ---------- */

.brand-auth {
    margin: 0;
    background: #f8fafc;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: var(--b-950);
    color: #fff;
}

.auth-brand > :not(.auth-ring) {
    position: relative;
}

.auth-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-ring-1 {
    top: -160px;
    right: -160px;
    width: 620px;
    height: 620px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-ring-2 {
    top: -96px;
    right: -96px;
    width: 460px;
    height: 460px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-ring-3 {
    top: -32px;
    right: -32px;
    width: 300px;
    height: 300px;
    background: linear-gradient(to bottom left, var(--b-500), transparent 70%);
    opacity: 0.45;
}

.auth-ring-4 {
    bottom: -190px;
    left: -130px;
    width: 520px;
    height: 520px;
    background: linear-gradient(to top right, var(--b-600), transparent 70%);
    opacity: 0.35;
    filter: blur(24px);
}

.auth-brand-logo {
    align-self: flex-start;
    width: auto;
    height: 56px;
}

.auth-pitch {
    max-width: 440px;
}

.auth-eyebrow {
    margin-bottom: 12px;
    color: var(--b-300);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.auth-pitch h2 {
    margin: 0;
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.auth-pitch h2 span {
    display: block;
    color: var(--b-300);
}

.auth-tagline {
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    line-height: 1.7;
}

.auth-copy {
    margin: 0;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
}

.auth-copy a {
    color: inherit;
    text-decoration: underline;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #f8fafc;
}

.auth-form-wrap {
    width: 100%;
    max-width: 384px;
}

.auth-mobile-logo {
    display: block;
    width: auto;
    height: 48px;
    margin-bottom: 32px;
}

.auth-form-wrap h1 {
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 1.9rem;
    font-weight: 700;
}

.auth-sub {
    margin-bottom: 28px;
    color: #64748b;
    font-size: 0.875rem;
}

.auth-form-wrap label {
    margin-bottom: 6px;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.auth-label-row a {
    font-size: 0.75rem;
    font-weight: 600;
}

body.brand-auth .auth-form-wrap .form-control {
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 0.95rem;
}

body.brand-auth .auth-form-wrap .form-control:focus {
    border-color: var(--b-600);
    box-shadow: 0 0 0 4px var(--b-100);
}

body.brand-auth .auth-submit {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 6px 14px -4px var(--b-400);
    font-size: 0.95rem;
    font-weight: 600;
}

.brand-auth .auth-form-wrap a {
    color: var(--b-700);
}

.auth-alt {
    margin-top: 28px;
    color: #64748b;
    font-size: 0.875rem;
    text-align: center;
}

.auth-alt a {
    font-weight: 600;
}

.auth-form-wrap .alert {
    border-radius: 8px;
    font-size: 0.875rem;
}

.auth-form-wrap .alert ul {
    margin: 0;
    padding-left: 18px;
}

@media (min-width: 992px) {
    .auth-split {
        grid-template-columns: 1.1fr 1fr;
    }

    .auth-brand {
        display: flex;
    }

    .auth-mobile-logo {
        display: none;
    }
}
