/* ═══════════════════════════════════════════════════════════════
   Drive Me — Shell chrome
   The sidebar and the header. Loaded by the layout, after driveme.css.

   CoreUI supplies the mechanics (the off-canvas sidebar, the sticky
   header); everything here is the part that makes them read as one
   product rather than a starter template.
═══════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────
   §1  SIDEBAR BRAND
────────────────────────────────────────────────────────────── */
.sidebar-brand {
    transition: opacity .2s ease, transform .2s ease;
}
.sidebar-brand:hover {
    opacity: .85;
    transform: scale(1.02);
}


/* ──────────────────────────────────────────────────────────────
   §2  SIDEBAR NAVIGATION

   Every section is a title followed by its items — no dividers as
   well. CoreUI's .nav-title already carries a top margin, so having
   both meant each section was separated twice over and the spacing
   read as accidental.
────────────────────────────────────────────────────────────── */
.sidebar-nav .nav-title {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    padding-top: .5rem;
    padding-bottom: .35rem;
    margin-top: .9rem;
    opacity: .65;
}

/* The first title sits directly under the brand's own border, so it
   does not need the gap that separates one section from the next. */
.sidebar-nav > .nav-title:first-child {
    margin-top: .35rem;
}

.sidebar-nav .nav-link {
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: .82rem;
    border-radius: 7px;
}

/* The active item gets a left marker as well as a background: on a
   dark sidebar the fill alone is a very quiet signal. */
.sidebar-nav .nav-link.active {
    position: relative;
    font-weight: 600;
}
.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--dm-accent, #F59E0B);
}

.sidebar-nav .nav-icon {
    font-size: .92rem;
}

/* Nested items line up under their parent's label rather than its
   icon, which is what makes the nesting visible at a glance. */
.sidebar-nav .nav-group-items .nav-link {
    font-size: .78rem;
    padding-top: .38rem;
    padding-bottom: .38rem;
}


/* ──────────────────────────────────────────────────────────────
   §3  HEADER
────────────────────────────────────────────────────────────── */
.header-toggler {
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
}

/* Quick actions promoted out of the sidebar — Live Map is something
   you reach for while looking at something else, so it lives where it
   is reachable from every page without opening the nav. */
.dm-header-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--dm-border, #E2E8F0);
    background: var(--dm-surface, #fff);
    color: var(--dm-txt-2, #334155);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    transition: all .15s ease;
    white-space: nowrap;
}
.dm-header-action:hover {
    border-color: var(--dm-brand, #4338CA);
    color: var(--dm-brand, #4338CA);
    background: var(--dm-brand-light, #EEF2FF);
}
.dm-header-action.active {
    border-color: var(--dm-brand, #4338CA);
    color: var(--dm-brand, #4338CA);
    background: var(--dm-brand-light, #EEF2FF);
}
.dm-header-action i { font-size: .85rem; }

/* A live indicator on the map action, since what it opens is moving. */
.dm-header-action .dm-header-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dm-success, #22C55E);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: dm-header-pulse 2s infinite;
    flex-shrink: 0;
}
@keyframes dm-header-pulse {
    70%  { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .dm-header-action .dm-header-dot { animation: none; }
}

/* The account button. Initials drawn here rather than fetched from an
   avatar service: it is one less external request on every page, and
   it can show who is actually signed in instead of the word "Admin". */
.dm-header-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dm-brand, #4338CA);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.header-nav .nav-link {
    color: var(--dm-txt-3, #64748B);
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
}
.header-nav .nav-link:hover {
    color: var(--dm-brand, #4338CA);
    background: var(--dm-brand-light, #EEF2FF);
}

.header-nav .dropdown-menu {
    min-width: 230px;
    border-color: var(--dm-border, #E2E8F0);
    box-shadow: var(--dm-shadow-md, 0 10px 30px rgba(15, 23, 42, .12));
}

/* ── Narrow screens ──
   The map action keeps its icon and loses its label: the header has
   room for one of the two, and the icon is the half that survives. */
@media (max-width: 575.98px) {
    .dm-header-action {
        padding: 6px 9px;
        gap: 0;
    }
    .dm-header-action .dm-header-label,
    .dm-header-action .dm-header-dot {
        display: none;
    }
}
