/* === General Reset === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.85rem;
    overflow: hidden;
}

body {
    display: flex;
    transition: all 0.3s ease;
}

/* === Sidebar === */
.sidebar {
    position: relative;
    width: 220px;
    min-width: 60px;
    max-width: 220px;
    min-height: 100vh;
    background-color: #343a40;
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 1100;
}

.sidebar-collapsed .sidebar {
    width: 60px;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo {
    width: 160px;
    transition: width 0.3s ease;
}

.sidebar-collapsed .logo {

    width: 70px;
}

/* Nav Links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    /* ✅ Makes links fill sidebar */
}

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    color: #adb5bd;
    text-transform: uppercase;
    padding: 0.5rem 1rem 0 1rem;
    transition: opacity 0.3s ease;
}

.sidebar .nav-link {
    width: 100%;
    color: #adb5bd;
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
}

.sidebar-collapsed .sidebar-nav .nav-section {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

.sidebar .nav-link .link-text {
    margin-left: 10px;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #495057;
    color: #fff;
    border-left: 3px solid #0d6efd;
}

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

.sidebar-collapsed .nav-link .link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.sidebar-collapsed .sidebar-footer {
    align-items: center;
}

.sidebar .username-text,
.sidebar .logout-text {
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .sidebar .username-text,
.sidebar-collapsed .sidebar .logout-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-footer .btn {
    width: 100%;
    padding: 0.3rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-align: center;
}

.sidebar-footer .user-info {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-bottom: 0.5rem;
}

/* === Toggle Button === */
.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -16px;
    /* Half of button width (32px) to overlap sidebar's edge */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #343a40;
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

/* Flip the icon when collapsed */
.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Default icon */
.sidebar-toggle i {
    transform: rotate(0);
    transition: transform 0.3s ease;
}

.sidebar-collapsed .sidebar-toggle {
    left: 50px;
}

.sidebar-toggle:hover {
    background-color: #495057;
}

/* === Content === */
.content {
    flex-grow: 1;
    padding-left: 1rem;
    overflow-y: auto;
    height: 100vh;
    transition: all 0.3s ease;
}

/* Default modal shift when sidebar is open */
.modal-adjusted {
    margin-left: 100px;
    transition: margin-left 0.3s ease;
}

/* Shift modal left when sidebar is collapsed */
.sidebar-collapsed .modal-adjusted {
    margin-left: 60px;
}

/* Solid black borders for the entire table */
.table-dark-border th,
.table-dark-border td {
    border: 1px solid #000;
}

/* Optional: make the header even bolder (optional, same as body) */
.table-dark-border thead th {
    border-color: #000;
}


/* === Responsive Cleanup (Optional) === */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
    }

    .sidebar-toggle {
        left: 230px;
    }

    .sidebar-collapsed .sidebar-toggle {
        left: 70px;
    }
}