:root {
    --adminlte-sidebar-bg: #343a40;
    --adminlte-sidebar-hover: #4a5058;
    --adminlte-sidebar-active: #0d6efd;
    --adminlte-sidebar-text: #c2c7d0;
    --adminlte-sidebar-text-active: #ffffff;
    --adminlte-sidebar-width: 250px;
    --adminlte-sidebar-collapsed-width: 69px;
    --adminlte-navbar-height: 57px;
    --adminlte-content-bg: #f4f6f9;
    --adminlte-card-bg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--adminlte-content-bg);
    margin: 0;
    padding: 0;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== MAIN HEADER / NAVBAR ========== */
.main-header {
    position: fixed;
    top: 0;
    left: var(--adminlte-sidebar-width);
    right: 0;
    height: var(--adminlte-navbar-height);
    z-index: 1034;
    border-bottom: 1px solid #dee2e6;
    transition: left 0.3s ease;
}

.main-header .nav-link {
    color: #495057;
    padding: 0.5rem 1rem;
}

.main-header .nav-link:hover {
    color: #000;
}

.user-menu .dropdown-menu {
    width: 250px;
    padding: 0;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.user-menu .user-header {
    padding: 1rem;
    text-align: center;
}

.user-menu .user-header p {
    margin: 0;
    font-weight: 600;
}

.user-menu .user-header small {
    font-weight: 400;
    opacity: 0.8;
}

.user-menu .user-footer {
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
}

/* ========== SIDEBAR ========== */
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--adminlte-sidebar-width);
    z-index: 1038;
    transition: width 0.3s ease, left 0.3s ease;
    overflow: hidden;
}

.sidebar {
    padding-top: 0.5rem;
    overflow-y: auto;
    height: calc(100vh - var(--adminlte-navbar-height));
    background: var(--adminlte-sidebar-bg);
}

.sidebar-dark-primary {
    background: var(--adminlte-sidebar-bg);
}

.brand-link {
    display: block;
    font-size: 1.25rem;
    line-height: 1.5;
    padding: 0.8125rem 0.5rem;
    transition: width 0.3s ease;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
}

.brand-link .brand-text {
    color: #fff;
    font-weight: 300;
}

.brand-link .brand-text b {
    color: #fff;
    font-weight: 700;
}

.sidebar .nav-sidebar {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .nav-sidebar > .nav-item {
    margin: 0;
}

.sidebar .nav-sidebar > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: var(--adminlte-sidebar-text);
    border-radius: 0;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background: var(--adminlte-sidebar-hover);
    color: #fff;
}

.sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background: var(--adminlte-sidebar-active);
    color: var(--adminlte-sidebar-text-active);
    box-shadow: inset 3px 0 0 #fff;
}

.sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon {
    margin-right: 0.5rem;
    font-size: 0.875rem;
    width: 1.6rem;
    text-align: center;
}

.sidebar .nav-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-weight: 700;
}

/* ========== CONTENT WRAPPER ========== */
.content-wrapper {
    margin-left: var(--adminlte-sidebar-width);
    margin-top: var(--adminlte-navbar-height);
    min-height: calc(100vh - var(--adminlte-navbar-height) - 50px);
    background: var(--adminlte-content-bg);
    transition: margin-left 0.3s ease;
}

.content-header {
    padding: 15px 0.5rem;
}

.content-header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #495057;
}

.content {
    padding: 0 0.5rem 1.5rem;
}

.breadcrumb {
    background: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

/* ========== CARDS ========== */
.card {
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* ========== STAT CARDS ========== */
.stat-card {
    border-radius: 0.25rem;
    padding: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .inner h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.stat-card .inner p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

.stat-card .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

.stat-card.bg-primary { background-color: #0d6efd; }
.stat-card.bg-success { background-color: #198754; }
.stat-card.bg-warning { background-color: #ffc107; color: #333; }
.stat-card.bg-danger { background-color: #dc3545; }
.stat-card.bg-info { background-color: #0dcaf0; color: #333; }

/* ========== TABLE ========== */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.table td {
    vertical-align: middle;
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ========== FORMS ========== */
.form-control:focus, .form-select:focus {
    border-color: var(--adminlte-sidebar-active);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ========== ALERTS ========== */
.alert {
    border: none;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ========== BADGES ========== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ========== FOOTER ========== */
.main-footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
    color: #869099;
    padding: 1rem;
    font-size: 0.875rem;
    margin-left: var(--adminlte-sidebar-width);
    transition: margin-left 0.3s ease;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo b {
    font-weight: 700;
    color: #fff;
    font-size: 2rem;
}

.login-logo span {
    color: rgba(255,255,255,0.8);
}

.login-card-body {
    background: #fff;
    border-radius: 0.25rem;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ========== CONTROL SIDEBAR ========== */
.control-sidebar {
    position: fixed;
    right: -300px;
    top: 0;
    bottom: 0;
    width: 300px;
    z-index: 1036;
    transition: right 0.3s ease;
    background: #fff;
}

.control-sidebar-dark {
    background: #343a40;
}

/* ========== SIDEBAR COLLAPSE ========== */
body.sidebar-collapse .main-sidebar {
    left: 0;
    width: var(--adminlte-sidebar-collapsed-width);
}

body.sidebar-collapse .main-sidebar .brand-text,
body.sidebar-collapse .sidebar .nav-link p,
body.sidebar-collapse .sidebar .nav-header {
    display: none;
}

body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-footer {
    margin-left: var(--adminlte-sidebar-collapsed-width);
}

body.sidebar-collapse .main-header {
    left: var(--adminlte-sidebar-collapsed-width);
}

body.sidebar-collapse .sidebar .nav-link {
    justify-content: center;
    padding: 0.625rem;
}

body.sidebar-collapse .sidebar .nav-link .nav-icon {
    margin-right: 0;
    font-size: 1rem;
}

/* ========== SMALL SCREENS ========== */
@media (max-width: 991.98px) {
    .main-sidebar {
        left: calc(-1 * var(--adminlte-sidebar-width));
    }

    .main-sidebar.sidebar-open {
        left: 0;
    }

    .content-wrapper,
    .main-footer,
    .main-header {
        margin-left: 0;
        left: 0;
    }
}

/* ========== UTILITIES ========== */
.text-sm { font-size: 0.875rem; }
.text-bold { font-weight: 600; }
.img-circle { border-radius: 50%; }
.img-size-50 { width: 50px; height: 50px; }
.elevation-1 { box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.elevation-2 { box-shadow: 0 3px 6px rgba(0,0,0,0.16); }
.elevation-4 { box-shadow: 0 10px 20px rgba(0,0,0,0.19); }

/* ========== SMALL BOX (AdminLTE style) ========== */
.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    display: block;
    margin-bottom: 20px;
    position: relative;
}
.small-box > .inner {
    padding: 10px;
}
.small-box > .inner h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: inherit;
}
.small-box > .inner p {
    font-size: 1rem;
    margin: 0;
}
.small-box .icon {
    color: rgba(0,0,0,0.15);
    z-index: 0;
}
.small-box .icon > i {
    font-size: 90px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}
.small-box > .small-box-footer {
    background-color: rgba(0,0,0,0.1);
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 3px 0;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 10;
    transition: background-color 0.3s;
}
.small-box > .small-box-footer:hover {
    background-color: rgba(0,0,0,0.15);
    color: #fff;
}
.small-box.bg-info { background-color: #17a2b8; color: #fff; }
.small-box.bg-info > .small-box-footer { background-color: rgba(0,0,0,0.1); color: rgba(255,255,255,0.8); }
.small-box.bg-success { background-color: #28a745; color: #fff; }
.small-box.bg-success > .small-box-footer { background-color: rgba(0,0,0,0.1); color: rgba(255,255,255,0.8); }
.small-box.bg-warning { background-color: #ffc107; color: #1a1a1a; }
.small-box.bg-warning > .small-box-footer { background-color: rgba(0,0,0,0.1); color: #1a1a1a; }
.small-box.bg-danger { background-color: #dc3545; color: #fff; }
.small-box.bg-danger > .small-box-footer { background-color: rgba(0,0,0,0.1); color: rgba(255,255,255,0.8); }

/* ========== PROFILE ========== */
.box-profile {
    text-align: center;
}
.profile-username {
    font-size: 1.25rem;
    font-weight: 600;
}
.card-primary.card-outline {
    border-top: 3px solid #0d6efd;
}
.card-info.card-outline {
    border-top: 3px solid #17a2b8;
}
