﻿/* === Global compact scaffolding === */
body.compact .app-shell {
    display: grid;
    grid-template-columns: 182px 1fr; /* narrower sidebar */
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
body.compact .sidebar {
    padding: 6px 6px;
}

/* Hide section labels on desktop; keep on very small screens */
body.compact .side-nav .nav-section {
    display: none;
}

@media (max-height:720px), (max-width: 1200px) {
    body.compact .side-nav .nav-section {
        display: block;
        font-size: .7rem;
        margin: 6px 6px 4px;
        opacity: .65;
        letter-spacing: .03em;
    }
}

/* Brand/logo */
body.compact .brand {
    padding: 4px 6px;
}

    body.compact .brand img {
        max-width: 96px;
        height: auto;
    }

/* Nav links: denser rows, better legibility */
body.compact .side-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px; /* tighter */
    font-size: .9rem;
    line-height: 1.05;
    border-radius: 8px;
    margin: 1px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2b2b2b;
}

    /* Subtle hover/active for clarity */
    body.compact .side-nav .nav-link:hover {
        background: #f2eef7;
    }

    body.compact .side-nav .nav-link.active {
        background: #e8defa;
        box-shadow: inset 0 0 0 1px #c4aaf2;
    }

/* Remove stray list spacing */
body.compact .side-nav .nav-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

    body.compact .side-nav .nav-item .nav-link {
        margin: 1px 2px;
    }

/* Icon chip smaller & sharper */
body.compact .side-nav .chip {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
}

    body.compact .side-nav .chip i {
        font-size: 13px;
        line-height: 1;
    }

/* Divider lines to cluster groups (auto when section titles hidden) */
body.compact .side-nav .nav-link + .nav-link {
    margin-top: 2px;
}

body.compact .side-nav .nav-link:nth-child(2n) {
}

/* ===== Top bar ===== */
body.compact .topbar {
    padding: 5px 10px;
    min-height: 38px;
}

body.compact .topbar-title {
    font-size: .98rem;
    margin: 0;
}

body.compact .topbar .btn {
    padding: 2px 7px;
    font-size: .8rem;
    line-height: 1.15;
    border-radius: 8px;
}

/* ===== Main content spacing ===== */
body.compact .page-wrap {
    padding: 8px;
}

body.compact .page-card {
    margin: 0;
    padding: 10px;
    border-radius: 12px;
}

    /* Tables denser but readable */
    body.compact .page-card .table th,
    body.compact .page-card .table td {
        padding: .3rem .45rem;
    }

/* Small buttons tighter */
body.compact .btn-sm {
    padding: .12rem .38rem;
    line-height: 1.05;
}

/* Make DataTables / inputs smaller if present */
body.compact input.form-control,
body.compact select.form-select {
    padding: .3rem .5rem;
    font-size: .9rem;
    line-height: 1.15;
}

/* When the viewport is short, tighten a bit more */
@media (max-height: 750px) {
    body.compact .side-nav .nav-link {
        padding: 4px 6px;
        font-size: .88rem;
    }

    body.compact .topbar {
        padding: 4px 8px;
    }
}

/* ===== Optional: zero edge whitespace feel ===== */
body.compact .main {
    padding: 0;
}

body.compact .page-wrap.container-fluid {
    padding-left: 10px;
    padding-right: 10px;
}
