:root {
    --primary: #0a4f9d;
    --primary-dark: #083a74;
    --secondary: #e8f1fb;
    --accent: #0ea5e9;
    --sidebar-width: 264px;
    --sidebar-collapsed-width: 82px;
    --text-main: #18324b;
    --text-soft: #6b7a90;
    --surface: #ffffff;
    --border: #d6e2f1;
    --shadow: 0 18px 42px rgba(14, 44, 85, 0.08);
    --radius-lg: 22px;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(10, 79, 157, 0.09), transparent 26%),
        radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.08), transparent 24%),
        #f4f8fc;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        linear-gradient(140deg, rgba(10, 79, 157, 0.94), rgba(8, 58, 116, 0.92)),
        #0a4f9d;
}

.auth-card {
    width: 100%;
    max-width: 760px;
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(4, 18, 38, 0.25);
}

.auth-brand {
    padding: 1.4rem;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent),
        linear-gradient(180deg, rgba(14, 165, 233, 0.2), transparent 55%);
}

.auth-form {
    padding: 1.4rem;
    background: #fff;
}

.auth-brand img {
    width: 48px;
    margin-bottom: 0.75rem !important;
}

.auth-brand h1 {
    font-size: 1.2rem;
    line-height: 1.25;
}

.auth-form .mt-4 {
    margin-top: 0.75rem !important;
}

.auth-form .mb-3 {
    margin-bottom: 0.55rem !important;
}

.auth-form h2 {
    font-size: 1.1rem;
}

.auth-form p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.auth-form .form-label,
.auth-form .form-text {
    font-size: 0.85rem;
}

.auth-form .form-control,
.auth-form .btn {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.captcha-box {
    display: grid;
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
}

.captcha-question {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #9ebadd;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff, #eef5fc);
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.login-wrapper {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(185, 110, 143, 0.84), rgba(52, 101, 159, 0.9)),
        radial-gradient(circle at 20% 18%, rgba(255, 233, 218, 0.58), transparent 28%),
        radial-gradient(circle at 84% 72%, rgba(24, 78, 135, 0.64), transparent 34%),
        #426f9f;
}

.login-wrapper::before {
    content: "";
    position: absolute;
    inset: -40px;
    background:
        radial-gradient(circle at 10% 90%, rgba(238, 173, 176, 0.52), transparent 22%),
        radial-gradient(circle at 74% 5%, rgba(17, 58, 104, 0.38), transparent 28%);
    filter: blur(16px);
}

.login-card {
    position: relative;
    width: min(100%, 360px);
    margin-top: 3.5rem;
    padding: 4.1rem 2.1rem 2rem;
    border-radius: 24px;
    background: rgba(239, 230, 236, 0.86);
    box-shadow:
        0 24px 54px rgba(24, 48, 83, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(10px);
}

.login-card::after {
    content: "";
    position: absolute;
    left: 2.4rem;
    right: 2.4rem;
    bottom: -22px;
    height: 36px;
    border-radius: 0 0 16px 16px;
    background: rgba(230, 229, 234, 0.78);
    box-shadow: 0 16px 28px rgba(25, 54, 87, 0.22);
    z-index: -1;
}

.login-logo {
    position: absolute;
    top: -58px;
    left: 50%;
    width: 112px;
    height: 112px;
    padding: 13px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #062c5d;
    border: 4px solid rgba(255, 255, 255, 0.42);
    box-shadow: 0 14px 28px rgba(12, 43, 82, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.login-title {
    margin: 0;
    color: #123760;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0;
}

.login-subtitle {
    margin: 0.2rem 0 1.15rem;
    color: #637085;
    font-size: 0.78rem;
    text-align: center;
}

.login-form {
    display: grid;
    gap: 0.7rem;
}

.login-field {
    display: flex;
    align-items: stretch;
    min-height: 44px;
    background: #254d77;
}

.login-field-icon {
    width: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #173c65;
    flex-shrink: 0;
}

.login-field .form-control {
    min-height: 44px;
    border: 0;
    border-radius: 0;
    background: #254d77;
    color: #fff;
    box-shadow: none;
    font-size: 0.88rem;
}

.login-field .form-control::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

.login-field .form-control:focus {
    background: #254d77;
    color: #fff;
}

.login-password-toggle {
    width: 44px;
    border: 0;
    background: #254d77;
    color: rgba(255, 255, 255, 0.78);
    flex-shrink: 0;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
    background: #1d426c;
    color: #fff;
    outline: 0;
}

.login-captcha {
    display: grid;
    gap: 0.45rem;
}

.login-captcha-question {
    min-height: 36px;
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.52);
    color: #123760;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.login-captcha-badge {
    color: #66778d;
    font-size: 0.64rem;
    font-weight: 800;
}

.login-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.1rem;
    font-size: 0.72rem;
}

.login-links a {
    color: #56657a;
    text-decoration: none;
}

.login-links a:hover {
    color: #123760;
}

.login-links-center {
    justify-content: center;
}

.login-note {
    margin: -0.15rem 0 0;
    color: #5f6b7d;
    font-size: 0.74rem;
}

.login-note-center {
    margin: -0.65rem 0 0.85rem;
    text-align: center;
}

.login-submit {
    width: 100%;
    min-height: 42px;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, #e4e6eb, #d8dce5);
    color: #31577f;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 16px 22px rgba(31, 62, 99, 0.22);
}

.login-submit:hover,
.login-submit:focus {
    background: linear-gradient(180deg, #f0f2f6, #dde2ea);
    color: #173c65;
    outline: 0;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1.2rem 0.85rem;
    box-shadow: 12px 0 40px rgba(5, 33, 67, 0.16);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar .brand {
    padding: 0.9rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 1.5rem;
    transition: padding 0.25s ease, border-radius 0.25s ease;
}

.sidebar .brand img {
    flex-shrink: 0;
}

.brand-text,
.sidebar-section-title,
.nav-text {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav {
    padding-bottom: 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.84);
    padding: 0.72rem 0.85rem;
    border-radius: 14px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    transition: padding 0.25s ease, justify-content 0.25s ease;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 29, 57, 0.42);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem;
    transition: margin-left 0.25s ease, padding 0.25s ease;
}

.topbar-search {
    min-width: 280px;
}

.topbar-login-as {
    min-width: 300px;
    position: relative;
}

.login-as-combobox {
    position: relative;
}

.login-as-toggle {
    width: 100%;
    height: 42px;
    border: 1px solid #cfe0f3;
    border-radius: 8px;
    background: #fff;
    color: #173b62;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    font-weight: 600;
}

.login-as-toggle:hover,
.login-as-combobox.is-open .login-as-toggle {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

.login-as-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-as-combobox.is-open .login-as-toggle i {
    transform: rotate(180deg);
}

.login-as-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1060;
    display: none;
    background: #fff;
    border: 1px solid #d9e5f2;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 38, 65, 0.16);
    padding: 10px;
}

.login-as-combobox.is-open .login-as-panel {
    display: block;
}

.login-as-search-wrap {
    height: 42px;
    border: 1px solid #d9e5f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 10px;
    color: #6b7f96;
}

.login-as-search {
    border: 0;
    outline: 0;
    width: 100%;
    min-width: 0;
    color: #173b62;
}

.login-as-options {
    max-height: 280px;
    overflow-y: auto;
}

.login-as-option {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #173b62;
    padding: 10px 12px;
    text-align: left;
}

.login-as-option:hover,
.login-as-option:focus {
    background: #eef5ff;
    outline: 0;
}

.topbar-actions {
    flex-wrap: wrap;
}

.svg-icon {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-icon.btn-sm {
    width: 34px;
    height: 34px;
}

.btn-icon .svg-icon {
    font-size: 1.08rem;
}

.btn-icon.btn-sm .svg-icon {
    font-size: 0.95rem;
}

.action-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.user-menu-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(12, 53, 100, 0.08);
}

.user-menu-toggle::after {
    display: none;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus {
    background: #eef7ff;
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--primary);
}

.user-menu-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-menu-toggle i {
    font-size: 1.25rem;
}

.user-dropdown {
    min-width: 230px;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
}

.sidebar-toggle {
    min-width: 46px;
    min-height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar,
.stat-card,
.content-card,
.hero-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(214, 226, 241, 0.8);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.topbar,
.hero-card,
.content-card,
.stat-card {
    padding: 1.25rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mini-stat {
    min-width: 170px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.9rem 1rem;
}

.master-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,247,255,.92));
    box-shadow: 0 10px 26px rgba(12, 53, 100, 0.06);
}

.empty-state {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--text-soft);
    background: #f8fbff;
}

.table thead th {
    background: #eef5fc;
    color: var(--text-main);
    border-bottom: 0;
    font-size: 0.86rem;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.91rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--border);
    min-height: 42px;
    font-size: 0.93rem;
}

.form-label,
.form-text,
.btn,
.alert,
.badge,
.small {
    font-size: 0.92rem;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 38px;
    padding: 0.35rem 0.65rem;
}

.report-dosen-table thead th {
    background: #f2f5f9;
    color: #5c6f85;
    font-size: 0.98rem;
    font-weight: 700;
    vertical-align: middle;
}

.report-dosen-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 0.97rem;
}

.report-dosen-table tbody td:nth-child(4) {
    color: #4a7dff;
    font-weight: 500;
}

.report-name-link {
    color: #4a7dff;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.table-row-number,
.table-row-number-header {
    width: 58px;
    text-align: center;
    white-space: nowrap;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar .brand {
    padding: 0.8rem 0.55rem;
    gap: 0 !important;
    justify-content: center;
}

body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .sidebar-section-title,
body.sidebar-collapsed .sidebar .nav-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar .sidebar-section-title {
    display: none;
}

body.sidebar-collapsed .sidebar .sidebar-scroll {
    padding-right: 0;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.72rem 0.5rem;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0 !important;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.timeline-item {
    border-left: 3px solid #cfe0f4;
    padding-left: 1rem;
    margin-left: 0.5rem;
    margin-bottom: 1rem;
}

.pegawai-card {
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(150deg, rgba(10, 79, 157, 0.95), rgba(14, 165, 233, 0.75));
    color: #fff;
}

.pegawai-card .qr-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 0.75rem;
}

@media (max-width: 991.98px) {
    .auth-wrapper {
        align-items: flex-start;
        padding: 0.75rem;
    }

    .auth-card {
        border-radius: 18px;
    }

    .auth-brand,
    .auth-form {
        padding: 1.25rem;
    }

    .auth-brand {
        display: none !important;
    }

    .auth-brand img {
        width: 52px;
    }

    .auth-brand h1 {
        font-size: 1.2rem;
    }

    .captcha-box {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: var(--sidebar-width);
        border-radius: 0 24px 24px 0;
        transform: translateX(calc(-100% - 20px));
    }

    .sidebar-scroll {
        overflow-y: auto;
        padding-right: 0.35rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 18px 0 50px rgba(5, 33, 67, 0.22);
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar-search {
        min-width: 100%;
    }
}
