html {
    font-size: 14px;
}

@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;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

/* ---------------------------
   Sidebar / layout (light)
----------------------------*/
.sidebar {
    width: 240px;
    min-height: 100vh;
    background-color: #ffffff;
}

    .sidebar .nav-link {
        color: #333;
        padding: 10px 12px;
        border-radius: 6px;
        margin-bottom: 4px;
    }

        .sidebar .nav-link:hover {
            background-color: #f1f3f5;
            color: #000;
        }

        .sidebar .nav-link.active {
            background-color: #e9ecef;
            font-weight: 600;
        }

.main-content {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.topbar {
    background-color: #ffffff;
}

/* Fix Bootstrap toggler icon when using a plain button */
.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: var(--bs-navbar-toggler-icon-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* ---------------------------
   Dark mode
   - OS preference
   - Manual override: html[data-theme="dark"]
----------------------------*/

/* 1) OS preference */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0b0f14;
        color: #e6e6e6;
    }

    .sidebar,
    .topbar,
    .offcanvas,
    .offcanvas-header {
        background-color: #0f1620 !important;
        color: #e6e6e6;
    }

    .border-end,
    .border-bottom,
    .border-top {
        border-color: #223042 !important;
    }

    .main-content {
        background-color: #0b0f14;
    }

    .nav-link {
        color: #cfd8e3 !important;
    }

        .nav-link:hover {
            background-color: #172232 !important;
            color: #ffffff !important;
        }

        .nav-link.active {
            background-color: #223042 !important;
            font-weight: 600;
        }

    .text-muted {
        color: #9aa7b7 !important;
    }
}

/* 2) Manual override forces dark */
html[data-theme="dark"] body {
    background-color: #0b0f14;
    color: #e6e6e6;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .offcanvas-header {
    background-color: #0f1620 !important;
    color: #e6e6e6;
}

html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top {
    border-color: #223042 !important;
}

html[data-theme="dark"] .main-content {
    background-color: #0b0f14;
}

html[data-theme="dark"] .nav-link {
    color: #cfd8e3 !important;
}

    html[data-theme="dark"] .nav-link:hover {
        background-color: #172232 !important;
        color: #ffffff !important;
    }

    html[data-theme="dark"] .nav-link.active {
        background-color: #223042 !important;
        font-weight: 600;
    }

html[data-theme="dark"] .text-muted {
    color: #9aa7b7 !important;
}
