* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

:root {
    --bg-body: #f4f6f8;
    --bg-sidebar: #ffffff;
    --bg-hover: #1e90ff;
    --text-main: #000000;
    --text-link: #1e90ff;
    --border-color: #dddddd;
    --icon-color: #1e90ff;
}

/* ===== DARK MODE ===== */
body.dark {
    --bg-body: #0f172a;        /* nền chính */
    --bg-sidebar: #020617;     /* sidebar */
    --bg-hover: #2563eb;       /* hover */
    --text-main: #e5e7eb;
    --text-link: #93c5fd;
    --border-color: #1e293b;
    --icon-color: #93c5fd;
}

body {
    background: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* ===== SIDEBAR ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    transition: all 0.4s ease;
    z-index: 1000;
}

nav.hide {
    width: 0;
    overflow: hidden;
}

/* Toggle button */
.toggle_menu {
    z-index: 3000;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.toggle_menu {
    background: var(--bg-sidebar);
}

.toggle_menu ion-icon {
    color: var(--icon-color);
}

.toggle_menu:hover {
    background: var(--bg-hover);
}

.toggle_menu:hover ion-icon {
    color: #fff;
}

/* Menu */
nav ul {
    list-style: none;
    margin-top: 80px;
}

nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-link);
    font-size: 1.1em;
    transition: background-color 0.3s, color 0.3s;
}

nav ul li a ion-icon {
    color: var(--icon-color);
    font-size: 1.3em;
    margin-right: 15px;
}

nav ul li a:hover {
    background: var(--bg-hover);
    color: #fff;
}

nav ul li a:hover ion-icon {
    color: #fff;
}

/* ===== CONTENT ===== */
.content {
    display: flex;
    flex: 1;
    margin-left: 250px;
    padding: 40px;
    padding-left: 90px;
    min-height: 100vh;
    transition: all 0.4s ease;
}

.content.expand {
    margin-left: 0;
}

.fixed-theme {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.theme-btn {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    float: right;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, border 0.3s;
}

.theme-btn ion-icon {
    font-size: 24px;
    color: var(--icon-color);
}

.theme-btn:hover {
    background: var(--bg-hover);
}

.theme-btn:hover ion-icon {
    color: #fff;
}

@media (max-width: 768px) {

    /* Sidebar */
    nav {
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    nav.show {
        transform: translateX(0);
    }

    nav.hide {
        width: 220px; /* giữ width */
        overflow: visible;
    }

    /* Content */
    .content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    /* Toggle menu */
    .toggle_menu {
        top: 20px;
        left: 20px;
        z-index: 3000;
    }

    /* Dark mode button */
    .fixed-theme {
        top: 20px;
        right: 20px;
    }
}
