/* =====================================================
   Enterprise Inventory & Asset Management — Dashboard CSS
   ===================================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 78px;
    --topbar-height: 68px;

    --color-dark: #0f2540;
    --color-dark-secondary: #16324f;
    --color-primary: #1e5f9e;
    --color-primary-light: #eaf3fb;
    --color-text-muted: #6c757d;
    --color-border: #e6e9ef;

    --color-blue: #1e5f9e;
    --color-green: #1f9d55;
    --color-amber: #d98c0e;
    --color-purple: #6f42c1;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f4f6f9;
    color: #212529;
    margin: 0;
    padding: 0;
}

/* ===================== APP WRAPPER ===================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--color-dark) 0%, var(--color-dark-secondary) 100%);
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    white-space: nowrap;
}

.sidebar-logo i {
    font-size: 1.6rem;
    color: #4dabf7;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.75);
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 95, 158, 0.4);
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 12px 4px;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1020;
}

/* Collapsed sidebar (desktop) */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .link-text {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px;
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    width: calc(100% - var(--sidebar-width));
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* ===================== TOPBAR ===================== */
.topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left .sidebar-toggle-btn {
    color: #495057;
}

.topbar-title {
    font-weight: 600;
    color: #1c2b3a;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.icon-btn {
    background: #f4f6f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.icon-btn:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.notif-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #e03131;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

/* User dropdown */
.user-dropdown-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-dropdown-btn:hover {
    background-color: #f4f6f9;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1c2b3a;
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.small-chevron {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ===================== PAGE CONTENT ===================== */
.page-content {
    padding: 28px;
    flex: 1;
}

.page-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--color-border);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    background: #ffffff;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05);
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    color: #ffffff;
}

.stat-card-blue .stat-card-icon { background: var(--color-blue); }
.stat-card-green .stat-card-icon { background: var(--color-green); }
.stat-card-amber .stat-card-icon { background: var(--color-amber); }
.stat-card-purple .stat-card-icon { background: var(--color-purple); }

.stat-card-body {
    display: flex;
    flex-direction: column;
}

.stat-card-label {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1c2b3a;
}

/* ===================== PANEL CARDS ===================== */
.panel-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05);
    overflow: hidden;
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--color-border);
}

.panel-card-title {
    font-weight: 600;
    color: #1c2b3a;
    margin: 0;
}

.panel-card-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
}

.panel-card-link:hover {
    text-decoration: underline;
}

/* Table */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    padding: 14px 22px;
    background-color: #fafbfc;
}

.table tbody td {
    padding: 14px 22px;
    font-size: 0.87rem;
    border-bottom: 1px solid var(--color-border);
    color: #344054;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: #f9fbfd;
}

/* Status badges */
.status-badge {
    padding: 5px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 20px;
}

.status-assigned {
    background-color: #e7f5ec;
    color: #1f9d55;
}

.status-available {
    background-color: #eaf3fb;
    color: #1e5f9e;
}

.status-maintenance {
    background-color: #fdf1e0;
    color: #d98c0e;
}

/* ===================== ACTIVITY LIST ===================== */
.activity-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    max-height: 420px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 12px 22px;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f9fbfd;
}

.activity-icon {
    color: var(--color-primary);
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 0.86rem;
    color: #1c2b3a;
}

.activity-desc {
    font-size: 0.82rem;
    color: #495057;
    margin-top: 2px;
}

.activity-meta {
    font-size: 0.74rem;
    color: var(--color-text-muted);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        z-index: 1040;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
        width: 100%;
    }

    .user-info {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 18px;
    }

    .topbar {
        padding: 0 16px;
    }

    .stat-card {
        padding: 18px;
    }
}