html {
    scroll-behavior: smooth;
}
body {
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111827;
    background: radial-gradient(circle at top left, rgba(13,110,253,0.22), transparent 24%),
                linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(13,110,253,0.06), rgba(255,255,255,0.9));
}
.login-card {
    position: relative;
    width: 100%;
    border-radius: 1.75rem;
    border: 1px solid rgba(13,110,253,0.12);
    overflow: hidden;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 2.2rem 3rem rgba(15, 23, 42, 0.12);
}
.login-card .row.g-0 {
    min-height: 520px;
}
.login-card-side {
    background: linear-gradient(180deg, rgba(13,110,253,0.95), rgba(102,16,242,0.9));
}
.login-card-side .badge {
    background: rgba(255,255,255,0.16) !important;
}
.login-card-side h3 {
    font-size: 2rem;
    font-weight: 700;
}
.login-card-side p {
    color: rgba(255,255,255,0.82);
}
.login-card-side-info {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 1rem;
    background: rgba(255,255,255,0.1);
}
.login-card-side-info p {
    color: rgba(255,255,255,0.85);
}
.login-card .card-body {
    position: relative;
    z-index: 1;
    padding: 2rem;
}
.login-card h3 {
    font-weight: 700;
    letter-spacing: -0.03em;
}
@media (max-width: 991.98px) {
    .login-card .row.g-0 {
        min-height: auto;
    }
    .login-card {
        border-radius: 1.4rem;
    }
    .login-card .card-body {
        padding: 1.75rem;
    }
}
.login-card .form-control,
.login-card .form-select {
    border-radius: 1.1rem;
    border: 1px solid #d8e2f3;
    background: #f8fafc;
    box-shadow: inset 0 0.35rem 0.75rem rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.login-card .form-control:hover,
.login-card .form-select:hover {
    transform: translateY(-1px);
}
.login-card .form-control::placeholder {
    color: #98a2b3;
}
.login-card .form-control:focus,
.login-card .form-select:focus {
    border-color: rgba(13,110,253,0.75);
    box-shadow: 0 0 0 0.16rem rgba(13,110,253,0.12);
}
.login-card .btn-primary {
    border-radius: 999px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    border: none;
    box-shadow: 0 0.95rem 1.95rem rgba(13,110,253,0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 1.1rem 2.2rem rgba(13,110,253,0.22);
}
.login-card .form-text {
    color: #6c757d;
}
.login-card .form-label {
    font-weight: 600;
    color: #344054;
}
.login-card .text-muted {
    color: #667085 !important;
}
.login-card .badge.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
}
.login-card .alert {
    border-radius: 1rem;
    box-shadow: 0 0.8rem 1.4rem rgba(15, 23, 42, 0.06);
}
.login-card .card-body > .text-center {
    margin-bottom: 1.75rem;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1060;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

/* Ensure action buttons (dark mode, notifications, logout) remain visible on small screens */
.mobile-topbar .btn.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.mobile-topbar .btn-outline-danger {
    display: inline-flex !important;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 78%;
        max-width: 320px;
        height: 100vh;
        padding-top: 4rem;
        overflow-y: auto;
        transform: translateX(-110%);
        transition: transform 0.28s ease, visibility 0.28s ease;
        z-index: 1045;
        display: block !important;
        visibility: hidden;
    }
    .sidebar.collapse.show {
        transform: translateX(0);
        visibility: visible;
    }
    .sidebar.collapse {
        display: block !important;
    }
    .sidebar-inner {
        min-height: calc(100vh - 4rem);
    }
    .sidebar .nav-link {
        padding: 0.85rem 1rem;
    }
    .sidebar .nav-link.active {
        background: rgba(255, 255, 255, 0.13);
        box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.25);
    }
    .sidebar-footer {
        padding-bottom: 1.25rem;
    }
    main {
        padding-top: 4.75rem;
    }
    .card {
        margin-bottom: 1.4rem;
    }
}

.payslip-card {
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2.2rem 3rem rgba(15, 23, 42, 0.09);
    border: 1px solid rgba(15, 23, 42, 0.04);
    position: relative;
}
.payslip-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(13,110,253,0.12), transparent 24%),
                radial-gradient(circle at bottom right, rgba(102,16,242,0.08), transparent 20%);
    pointer-events: none;
}
.payslip-card .card-body {
    position: relative;
    z-index: 1;
}
.payslip-item {
    min-height: 110px;
}
.payslip-item p {
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}
.payslip-item h5,
.payslip-item h6 {
    color: #0f172a;
}
.payslip-summary {
    background: linear-gradient(180deg, rgba(13,110,253,0.05), rgba(255,255,255,0.9));
    border: 1px solid rgba(13,110,253,0.12);
}
.payslip-summary strong {
    font-size: 1.15rem;
}
.payslip-summary .text-success {
    color: #0f5132 !important;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    padding: 1rem 0;
}
.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
    padding: 0 1rem;
}
.resume-sidebar {
    flex: 0 0 300px;
    min-width: 280px;
}
.resume-main {
    flex: 1;
    min-width: 320px;
}
.profile-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
}
.profile-avatar {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #eef3ff;
}
.profile-tag {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #e7f1ff;
    color: #0d6efd;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.profile-meta p {
    margin-bottom: 1rem;
    line-height: 1.5;
}
.profile-meta strong {
    color: #111827;
}
.profile-details-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.profile-details-row div {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.profile-details-row div:last-child {
    border-bottom: none;
}
.profile-details-row strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #0f172a;
}
.profile-details-row p {
    margin: 0;
    color: #475569;
}
.card.p-4 {
    border-radius: 1rem;
}
.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
    padding: 0 1rem;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.18);
    margin-bottom: 1rem;
}
.sidebar-brand h5 { margin-bottom: 0.2rem; font-weight: 600; font-size: 0.95rem; }
.sidebar-brand p { margin-bottom: 0; font-size: 0.75rem; opacity: 0.8; }
.sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    padding: 4px;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.16);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1rem;
}
.sidebar-section-title {
    margin: 0 0 0.4rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}
.sidebar .nav-link {
    color: rgba(255,255,255,.9);
    border-radius: 0.75rem;
    padding: 0.7rem 0.8rem;
    transition: all 0.2s ease;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.16);
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.logout-link {
    color: #ffe6e6 !important;
}
.card { border: none; box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,.08); }
.table th { background: #f8f9fa; }

/* Dark Mode */
/* Dark mode removed */

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Mobile Typography - Improved readability on small screens */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    body {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }
    h1 { font-size: 1.75rem !important; margin-bottom: 1rem; }
    h2 { font-size: 1.5rem !important; margin-bottom: 0.9rem; }
    h3 { font-size: 1.25rem !important; margin-bottom: 0.8rem; }
    h4 { font-size: 1.1rem !important; margin-bottom: 0.7rem; }
    h5 { font-size: 1rem !important; margin-bottom: 0.6rem; }
    h6 { font-size: 0.9rem !important; margin-bottom: 0.5rem; }
    p { font-size: 0.95rem; line-height: 1.6; }
    small { font-size: 0.85rem; }
}

/* Mobile Container & Spacing */
@media (max-width: 576px) {
    .container-fluid {
        padding: 0;
    }
    main {
        padding: 1rem 0.75rem !important;
    }
    .px-md-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Mobile Cards */
@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 0.125rem 0.35rem rgba(0,0,0,.06) !important;
    }
    .card-body {
        padding: 1rem;
    }
    .card-header {
        padding: 0.75rem 1rem;
    }
    .card-footer {
        padding: 0.75rem 1rem;
    }
}

/* Mobile Tables - Responsive scrolling */
@media (max-width: 576px) {
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }
    table {
        min-width: 600px;
        margin-bottom: 0;
    }
    .table thead {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
    }
    .table th,
    .table td {
        padding: 0.65rem 0.5rem;
        font-size: 0.9rem;
        word-break: break-word;
    }
    .table th {
        white-space: nowrap;
    }
}

/* Mobile Forms */
@media (max-width: 576px) {
    .form-group,
    .mb-3 {
        margin-bottom: 1rem;
    }
    .form-label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    .form-control,
    .form-select,
    .form-check-input,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.65rem 0.75rem;
        border-radius: 0.5rem;
        width: 100%;
    }
    .form-control:focus,
    .form-select:focus {
        border-color: rgba(13,110,253,0.75);
        box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.12);
    }
    textarea {
        min-height: 120px;
        resize: vertical;
    }
    .form-check {
        padding-left: 1.75rem;
        margin-bottom: 0.75rem;
    }
    .input-group {
        flex-wrap: wrap;
    }
}

/* Mobile Buttons - Touch-friendly sizing */
@media (max-width: 576px) {
    .btn {
        font-size: 0.95rem;
        padding: 0.65rem 1rem;
        border-radius: 0.5rem;
        min-height: 44px; /* Touch target minimum */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-height: auto;
    }
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    .btn-block,
    .w-100 {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    /* Stack buttons vertically on mobile */
    .btn-group-vertical .btn {
        width: 100%;
        border-radius: 0.5rem;
    }
}

/* Mobile Modal/Offcanvas */
@media (max-width: 576px) {
    .modal-content {
        border-radius: 1rem 1rem 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-header {
        padding: 1rem;
    }
    .modal-body {
        padding: 1rem;
    }
    .modal-footer {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .modal-header .btn-close {
        padding: 0.5rem;
    }
    .offcanvas {
        width: 100% !important;
        max-width: 100%;
    }
}

/* Mobile Row Columns */
@media (max-width: 576px) {
    .row {
        gap: 0.75rem;
    }
    .col-12 {
        margin-bottom: 0;
    }
    [class*="col-"] {
        padding: 0.5rem;
    }
}

/* Mobile Lists */
@media (max-width: 576px) {
    .list-group-item {
        padding: 0.85rem;
        font-size: 0.95rem;
    }
    .list-group-item.active {
        background: rgba(13,110,253,0.85);
        border-color: rgba(13,110,253,0.85);
    }
    .dropdown-menu {
        font-size: 0.95rem;
    }
    .dropdown-item {
        padding: 0.65rem 1rem;
    }
}

/* Mobile Alerts & Badges */
@media (max-width: 576px) {
    .alert {
        padding: 0.9rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }
    .badge {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        font-weight: 600;
    }
    .badge-lg {
        padding: 0.5rem 0.8rem;
    }
}

/* Mobile Pagination */
@media (max-width: 576px) {
    .pagination {
        gap: 0.25rem;
    }
    .page-link {
        padding: 0.5rem 0.65rem;
        font-size: 0.9rem;
        border-radius: 0.3rem;
    }
    .page-item.active .page-link {
        background: rgba(13,110,253,0.9);
    }
}

/* Mobile Navbar & Top Navigation */
@media (max-width: 576px) {
    .navbar {
        padding: 0.75rem 0.5rem;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .mobile-topbar {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .mobile-topbar .btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Mobile Profile Cards */
@media (max-width: 576px) {
    .profile-card {
        padding: 1.25rem 1rem;
        text-align: center;
    }
    .profile-avatar {
        width: 100px;
        height: 100px;
        border-width: 4px;
    }
    .profile-details-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .profile-meta p {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }
}

/* Mobile Sidebar Brand */
@media (max-width: 576px) {
    .sidebar-brand {
        gap: 0.35rem;
    }
    .sidebar-logo {
        width: 40px;
        height: 40px;
    }
    .sidebar-brand h5 {
        font-size: 0.85rem;
    }
    .sidebar-brand p {
        font-size: 0.7rem;
    }
}

/* Mobile Data Display */
@media (max-width: 576px) {
    .payslip-item {
        min-height: auto;
        padding: 0.75rem 0;
    }
    .payslip-summary {
        padding: 1rem;
    }
    .payslip-summary strong {
        font-size: 1.05rem;
    }
}

/* Mobile Grid/Flex Adjustments */
@media (max-width: 576px) {
    .row.g-0 {
        gap: 0;
    }
    .row.g-2 {
        gap: 0.5rem;
    }
    .row.g-3 {
        gap: 0.75rem;
    }
    .row.g-4 {
        gap: 1rem;
    }
}

/* Mobile Text Utilities */
@media (max-width: 576px) {
    .text-center,
    .text-md-left {
        text-align: center;
    }
    .text-truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Mobile Utility Spacing Adjustments */
@media (max-width: 576px) {
    .mt-1, .mt-2, .mt-3, .mt-4 { margin-top: 0.75rem !important; }
    .mb-1, .mb-2, .mb-3, .mb-4 { margin-bottom: 0.75rem !important; }
    .ms-1, .ms-2, .ms-3, .ms-4 { margin-left: 0.5rem !important; }
    .me-1, .me-2, .me-3, .me-4 { margin-right: 0.5rem !important; }
    .p-3, .p-4 { padding: 1rem !important; }
    .px-3, .px-4 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
    .py-3, .py-4 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
}

/* Mobile Login Page Optimization */
@media (max-width: 576px) {
    .login-page {
        padding: 1rem;
    }
    .login-card {
        border-radius: 1rem;
        box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.08);
    }
    .login-card .card-body {
        padding: 1.5rem 1rem;
    }
    .login-card-side {
        display: none;
    }
    .login-card .row.g-0 {
        min-height: auto;
    }
}

/* Mobile Menu/Hamburger Icon */
@media (max-width: 576px) {
    .mobile-menu-toggler {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .mobile-menu-toggler i {
        margin-right: 0.25rem;
    }
}

/* Mobile Dropdown Trigger Area */
@media (max-width: 576px) {
    [data-bs-toggle="dropdown"],
    [data-bs-toggle="collapse"],
    [data-bs-toggle="modal"] {
        cursor: pointer;
        user-select: none;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Mobile Scrollbar Styling */
@media (max-width: 576px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* Mobile Input Group */
@media (max-width: 576px) {
    .input-group {
        flex-wrap: nowrap;
    }
    .input-group > * {
        min-width: 0;
    }
    .input-group-text {
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
    }
}

/* Mobile Responsive Images */
@media (max-width: 576px) {
    img {
        max-width: 100%;
        height: auto;
    }
    .img-fluid {
        max-width: 100%;
    }
    figure {
        margin: 1rem 0;
    }
}

/* Mobile Utilities Visibility */
@media (max-width: 576px) {
    .d-none,
    .d-sm-none {
        display: none !important;
    }
    .d-sm-block,
    .d-sm-inline,
    .d-sm-inline-block,
    .d-sm-flex {
        display: block !important;
    }
}

/* Tablet Adjustments (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    html {
        font-size: 15px;
    }
    main {
        padding: 1.5rem 1rem !important;
    }
    .card-body {
        padding: 1.25rem;
    }
    .form-control,
    .form-select {
        font-size: 15px;
    }
    .btn {
        padding: 0.6rem 1.1rem;
    }
}
