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;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
    --sidebar-width: 280px;
    --primary-color: #0d6efd;
    --sidebar-bg: #ffffff;
    --body-bg: #f8f9fa;
}

body {
    background-color: var(--body-bg);
}

/* Layout Structure */
.page {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-left: 1px solid #eee; /* for RTL */
    position: fixed;
    top: 0;
    right: 0; /* RTL */
    height: 100vh;
    z-index: 1050;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0,0,0,0.03);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-weight: 800;
    font-size: 1.2rem;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    margin-bottom: 0.8rem;
    margin-top: 1rem;
    padding-right: 10px;
}

.nav-link {
    color: #555;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

    .nav-link i {
        font-size: 1.1rem;
        color: #888;
        transition: 0.2s;
    }

    .nav-link:hover {
        background-color: #f8f9fa;
        color: var(--primary-color);
    }

        .nav-link:hover i {
            color: var(--primary-color);
        }

    .nav-link.active {
        background-color: #eef2ff; /* Light blue bg */
        color: var(--primary-color);
    }

        .nav-link.active i {
            color: var(--primary-color);
        }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
}

.btn-logout {
    background: #fff0f0;
    color: #dc3545;
    border: none;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

    .btn-logout:hover {
        background: #dc3545;
        color: white;
    }

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width); /* RTL */
    transition: margin 0.3s ease;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.avatar {
    width: 38px;
    height: 38px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
}

/* Scrollbar Customization */
.custom-scroll::-webkit-scrollbar {
    width: 5px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 4px;
}

    .custom-scroll::-webkit-scrollbar-thumb:hover {
        background: #ddd;
    }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%); /* Hide right */
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-right: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 1045;
        backdrop-filter: blur(2px);
    }
}