/* Dashboard chrome: narrow floating sidebar + full-width header (static CSS). */
:root {
    --dash-sidebar-w: 13rem;          /* 208px — narrower than old 16rem */
    --dash-sidebar-collapsed-w: 4rem; /* 64px */
    --dash-sidebar-gap: 0.5rem;
    --dash-topbar-h: 3.5rem;
    --dash-sidebar-from: #c5e017;
    --dash-sidebar-mid: #90B800;
    --dash-sidebar-to: #6f8f00;
    --dash-sidebar: #90B800;
    --dash-sidebar-border: transparent;
    --dash-sidebar-text: #1a1a1a;
    --dash-sidebar-muted: rgba(26, 26, 26, 0.62);
    --dash-sidebar-hover: rgba(0, 0, 0, 0.08);
    --dash-sidebar-active: #111827;
    --dash-sidebar-active-text: #ffffff;
    --dash-topbar: #ffffff;
}

html.dark {
    --dash-sidebar-from: #8fb000;
    --dash-sidebar-mid: #6f8f00;
    --dash-sidebar-to: #556e00;
    --dash-sidebar: #6f8f00;
    --dash-sidebar-text: #111827;
    --dash-sidebar-muted: rgba(17, 24, 39, 0.7);
    --dash-sidebar-hover: rgba(0, 0, 0, 0.12);
    --dash-sidebar-active: #0a0a0a;
    --dash-sidebar-active-text: #ffffff;
    --dash-topbar: #111113;
}

/* ── Floating sidebar ── */
.dash-sidebar {
    position: fixed !important;
    z-index: 40;
    display: flex;
    flex-direction: column;
    top: calc(var(--dash-topbar-h) + var(--dash-sidebar-gap)) !important;
    bottom: var(--dash-sidebar-gap) !important;
    left: var(--dash-sidebar-gap) !important;
    height: auto !important;
    inset-block: auto;
    background: linear-gradient(
        180deg,
        var(--dash-sidebar-from) 0%,
        var(--dash-sidebar-mid) 48%,
        var(--dash-sidebar-to) 100%
    ) !important;
    border: none !important;
    border-radius: 0 1.5rem 1.5rem 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    color: var(--dash-sidebar-text);
    transition: width 0.3s ease, transform 0.3s ease;
}

@media (max-width: 1023px) {
    .dash-sidebar {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        border-radius: 0 1.25rem 1.25rem 0 !important;
        height: 100% !important;
    }
}

.dash-sidebar .dash-brand {
    height: auto;
    min-height: 3.25rem;
    padding: 0.85rem 0.85rem 0.5rem;
    border-bottom: none !important;
}

.dash-sidebar .dash-sidebar-footer {
    padding: 0.65rem 0.75rem 0.85rem;
    border-top: none !important;
}

.dash-sidebar .dash-nav-link {
    color: var(--dash-sidebar-muted) !important;
    border-radius: 9999px !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    gap: 0.65rem !important;
}

.dash-sidebar .dash-nav-link:hover {
    background-color: var(--dash-sidebar-hover) !important;
    color: var(--dash-sidebar-text) !important;
}

.dash-sidebar .dash-nav-link.active {
    background-color: var(--dash-sidebar-active) !important;
    color: var(--dash-sidebar-active-text) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.dash-sidebar .dash-nav-link svg {
    width: 1.05rem !important;
    height: 1.05rem !important;
    color: inherit !important;
}

.dash-sidebar .dash-nav-section {
    padding: 0.35rem 0.85rem 0.45rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dash-sidebar-muted);
}

.dash-sidebar .dash-collapse-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background: var(--dash-sidebar-active);
    color: var(--dash-sidebar-active-text);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.dash-sidebar .dash-collapse-btn:hover {
    opacity: 0.92;
}

.dash-sidebar .dash-collapse-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.dash-sidebar .text-brand-700,
.dash-sidebar .text-accent-600,
.dash-sidebar .dark\:text-zinc-100,
.dash-sidebar .text-zinc-100,
.dash-sidebar .text-white,
.dash-sidebar .text-white\/75,
.dash-sidebar .text-white\/70 {
    color: var(--dash-sidebar-text) !important;
}

.dash-sidebar .text-\[color\:var\(--dash-muted\)\],
.dash-sidebar p.text-\[10px\] {
    color: var(--dash-sidebar-muted) !important;
}

.dash-sidebar .text-\[color\:var\(--dash-text\)\] {
    color: var(--dash-sidebar-text) !important;
}

/* ── Full-width header ── */
.dash-topbar {
    left: 0 !important;
    right: 0 !important;
    height: var(--dash-topbar-h) !important;
    background-color: var(--dash-topbar) !important;
    border-bottom: 1px solid var(--dash-border) !important;
    backdrop-filter: none !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.dash-topbar.is-collapsed {
    left: 0 !important;
}

.dash-topbar-inner {
    max-width: none;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

@media (min-width: 640px) {
    .dash-topbar-inner {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

.dash-search {
    display: none;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem !important;
    padding: 0 1rem !important;
    border-radius: 9999px !important;
    background-color: #f3f4f6 !important;
    border: none !important;
    color: var(--dash-muted);
    width: min(28rem, 42vw) !important;
}

html.dark .dash-search {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

@media (min-width: 768px) {
    .dash-search {
        display: flex !important;
    }
}

.dash-search:focus-within {
    background-color: #eceef2 !important;
    box-shadow: 0 0 0 2px rgba(144, 184, 0, 0.25);
    border: none !important;
}

.dash-header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.dash-header-brand img {
    height: 1.85rem;
    width: 1.85rem;
    object-fit: contain;
    flex-shrink: 0;
}

.dash-header-brand-title {
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--dash-text);
    white-space: nowrap;
}

.dash-header-brand-sub {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--dash-muted);
    letter-spacing: 0.02em;
}

.dash-header-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 2.25rem;
    padding: 0.15rem 0.45rem 0.15rem 0.15rem;
    border-radius: 9999px;
    transition: background-color 0.15s ease;
}

.dash-header-profile:hover {
    background-color: var(--dash-hover);
}

.dash-header-profile-meta {
    display: none;
    text-align: right;
    line-height: 1.15;
}

@media (min-width: 640px) {
    .dash-header-profile-meta {
        display: block;
    }
}

.dash-header-profile-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dash-text);
}

.dash-header-profile-role {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--dash-muted);
}

/* ── Main offset for floating sidebar ── */
@media (min-width: 1024px) {
    .dash-main {
        padding-left: calc(var(--dash-sidebar-w) + var(--dash-sidebar-gap) * 2) !important;
    }

    .dash-main.is-collapsed {
        padding-left: calc(var(--dash-sidebar-collapsed-w) + var(--dash-sidebar-gap) * 2) !important;
    }
}
