/* Site CSS for Asset Inventory System */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #f4f6f9;
}

/* ===== Sidebar ===== */
#sidebar {
    width: 240px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, #1a3a5c 0%, #1e4976 100%);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-header {
    padding: 1.2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-brand:hover {
    color: #d0e4ff;
    text-decoration: none;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-item {
    margin: 1px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.2rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: rgba(255,255,255,0.5);
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #5ba8ff;
    font-weight: 500;
}

.sidebar-icon {
    width: 26px;
    text-align: center;
    margin-right: 0.7rem;
    flex-shrink: 0;
    font-size: 1rem;
}

.sidebar-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.25s;
    opacity: 0.6;
}

.has-submenu .sidebar-link[aria-expanded="true"] .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.15);
}

.sidebar-submenu .sidebar-link {
    padding-left: 3.2rem;
    font-size: 0.85rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.5rem 1rem;
}

/* ===== Content Wrapper ===== */
#content-wrapper {
    margin-left: 240px;
    width: calc(100% - 240px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    min-height: 50px;
}

#sidebarToggle {
    border: none;
    font-size: 1.2rem;
    color: #555;
    background: transparent;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

#sidebarToggle:hover {
    background: #e9ecef;
    color: #1a3a5c;
}

/* ===== Sidebar collapsed state ===== */
body.sidebar-collapsed #sidebar {
    margin-left: -240px;
}

body.sidebar-collapsed #content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -240px;
    }

    #content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-open #sidebar {
        margin-left: 0;
    }

    body.sidebar-open #content-wrapper {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
}

.footer {
    margin-top: auto;
    height: 50px;
    line-height: 50px;
    background-color: #fff;
    font-size: 0.85rem;
    color: #888;
}

/* Custom styles */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
}

.table th {
    white-space: nowrap;
}

/* Status badges */
.badge-found {
    background-color: #198754;
}

.badge-missing {
    background-color: #dc3545;
}

.badge-unexpected {
    background-color: #ffc107;
    color: #000;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
