* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    overflow-x: hidden;
}

a { text-decoration: none; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8, #2563eb);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
}

.login-head {
    padding: 28px 30px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
}

.login-head h1 { margin: 0; font-size: 30px; }
.login-head p { margin: 8px 0 0; opacity: .95; font-size: 14px; }

.login-body { padding: 28px 30px 30px; }

.install-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
}

.install-modal.open {
    display: flex;
}

.install-modal-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 26px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .35);
    text-align: center;
}

.install-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.install-modal-close:hover {
    background: #e2e8f0;
}

.install-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.install-modal-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.install-modal h2 {
    margin: 0 28px 8px;
    font-size: 22px;
    color: #0f172a;
}

.install-modal p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
}

.install-modal-steps {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    line-height: 1.55;
    text-align: left;
}

.install-modal-steps.is-highlighted {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.install-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.install-modal-actions .btn-primary,
.install-modal-actions .btn-success {
    flex: 1;
}

.form-group { margin-bottom: 18px; }

.form-label {
    display:block;
    margin-bottom:8px;
    font-weight:600;
    font-size:14px;
}

.form-control {
    width: 100%;
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    outline: none;
    font-size: 15px;
    background: #fff;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.form-control[readonly],
.form-control-readonly {
    background: #e5e7eb;
    border-color: #cbd5e1;
    color: #475569;
    cursor: not-allowed;
}

.form-control[readonly]:focus,
.form-control-readonly:focus {
    border-color: #cbd5e1;
    box-shadow: none;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus {
    background: #f1f5f9;
    color: #1d4ed8;
    outline: none;
}

.password-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(37,99,235,.16);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .icon-eye-off,
.password-toggle[aria-pressed="true"] .icon-eye {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
    display: block;
}

.captcha-wrap {
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:10px;
}

.captcha-text {
    min-width: 120px;
    height: 46px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    font-size:18px;
    padding:0 14px;
}

.btn-refresh {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    cursor: pointer;
}

.btn-refresh:hover { background:#cbd5e1; }

.btn-primary, .btn-danger, .btn-success {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    cursor:pointer;
    font-weight:700;
}

.btn-primary {
    height:46px;
    border-radius:12px;
    background:linear-gradient(135deg,#1d4ed8,#2563eb);
    color:#fff;
    padding:0 18px;
}

.btn-danger {
    height:36px;
    border-radius:10px;
    background:#dc2626;
    color:#fff;
    padding:0 14px;
}

.btn-success {
    height:46px;
    border-radius:12px;
    background:#16a34a;
    color:#fff;
    padding:0 18px;
}

.btn-block { width:100%; }

.alert {
    padding:12px 14px;
    border-radius:12px;
    margin-bottom:16px;
    font-size:14px;
}

.alert-danger {
    background:#fef2f2;
    color:#b91c1c;
    border:1px solid #fecaca;
}

.alert-success {
    background:#f0fdf4;
    color:#166534;
    border:1px solid #bbf7d0;
}

.dashboard {
    display:flex;
    min-height:100vh;
}

.sidebar {
    width:250px;
    background:#0f172a;
    color:#fff;
    padding:24px 18px;
    position: relative;
    transition: width .2s ease, padding .2s ease;
}

.sidebar-hide-toggle,
.sidebar-show-toggle {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 10px 25px rgba(15,23,42,.16);
    z-index: 20;
}

.sidebar-hide-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.1);
    color: #fff;
}

.sidebar-hide-toggle:hover {
    background: rgba(255,255,255,.18);
}

.sidebar-show-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    display: none;
    background: #0f172a;
    color: #fff;
    z-index: 9999;
}

.sidebar-show-toggle:hover {
    background: #1e293b;
}

html.sidebar-hidden .sidebar {
    display: none;
}

html.sidebar-hidden .sidebar-show-toggle {
    display: inline-flex;
}

html.sidebar-hidden .main {
    padding-left: 74px;
}

.sidebar h2 {
    margin-top:0;
    font-size:22px;
}

.sidebar a {
    display:flex;
    align-items:center;
    gap:10px;
    color:#cbd5e1;
    padding:10px 12px;
    border-radius:12px;
    margin-bottom:6px;
    font-size:14px;
    font-weight:700;
    line-height:1.3;
}

.sidebar-link span {
    min-width:0;
}

.sidebar-icon {
    width:18px;
    height:18px;
    flex:0 0 18px;
    color:#93c5fd;
}

.sidebar-group {
    margin-top:16px;
}

.sidebar-group-title {
    margin:0 0 8px;
    padding:0 12px;
    color:#94a3b8;
    font-size:11px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.sidebar-logout {
    margin-top:16px;
    border-top:1px solid rgba(255,255,255,.12);
}

.sidebar a:hover,
.sidebar a.active {
    background:rgba(255,255,255,.08);
    color:#fff;
}

.sidebar a:hover .sidebar-icon,
.sidebar a.active .sidebar-icon {
    color:#fff;
}

.main {
    flex:1;
    padding:76px 24px 24px;
    min-width: 0;
}

.topbar {
    background:#fff;
    padding:18px 22px;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(15,23,42,.06);
    margin-bottom:20px;
}

.cards {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:20px;
}

.card,
.table-wrap {
    background:#fff;
    border-radius:16px;
    padding:20px;
    box-shadow:0 10px 30px rgba(15,23,42,.06);
}

.card h3,
.card h4 {
    margin-top:0;
}

.metric {
    font-size:30px;
    font-weight:700;
    margin-top:10px;
    color:#1d4ed8;
}

.table-head {
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:16px;
}

.table {
    width:100%;
    border-collapse:collapse;
}

.table th,
.table td {
    padding:12px;
    border-bottom:1px solid #e2e8f0;
    text-align:left;
    font-size:14px;
    vertical-align:top;
}

.badge {
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.badge-admin { background:#dbeafe; color:#1d4ed8; }
.badge-dosen { background:#fef3c7; color:#b45309; }
.badge-mahasiswa { background:#dcfce7; color:#15803d; }
.badge-aman { background:#dcfce7; color:#15803d; }
.badge-tidak-aman { background:#fee2e2; color:#b91c1c; }

.toolbar {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.pagination {
    margin-top:18px;
}

.pagination a {
    display:inline-block;
    min-width:38px;
    padding:10px 12px;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    margin-right:6px;
    box-shadow:0 6px 18px rgba(15,23,42,.05);
}

.pagination a.active {
    background:#1d4ed8;
    color:#fff;
}

.pagination a.disabled {
    pointer-events: none;
    opacity: .45;
}

.page-info {
    display:inline-block;
    padding:10px 12px;
    color:#475569;
    font-weight:700;
}

.grid-2 {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}

textarea.form-control {
    height:auto;
    min-height:120px;
    padding:12px 14px;
}

#adminChart {
    width: 100% !important;
    min-height: 320px;
}

#checkinMap {
    width: 100%;
    min-height: 600px;
}

.toolbar .form-control {
    min-width: 160px;
}

.five-cards {
    grid-template-columns: repeat(5, 1fr);
}

.small-muted {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.photo-preview-wrap {
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.foto-preview {
    display: none;
    max-width: 100%;
    max-height: 320px;
    border-radius: 12px;
}

.sidebar-user-box {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-user-photo {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.25);
    background: #fff;
}

.placeholder-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    color: #fff;
}

.sidebar-user-name {
    margin-top: 10px;
    font-weight: 700;
    color: #fff;
}

.sidebar-user-role {
    margin-top: 4px;
    font-size: 12px;
    color: #cbd5e1;
}

/* =====================================================
   TOP ACTIONS: NOTIFIKASI + PROFIL USER
   Sudah diperbaiki agar tidak keluar layar di HP
===================================================== */

.top-actions {
    position: fixed;
    top: 14px;
    left: 70px;
    right: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9998;
}

.academic-year-pill {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(15,23,42,.14);
    white-space: nowrap;
}

.top-menu {
    position: relative;
}

.top-icon-btn,
.user-toggle {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15,23,42,.14);
    position: relative;
}

.top-icon-btn:hover,
.user-toggle:hover {
    background: #f8fafc;
}

.bell-icon {
    font-size: 19px;
    line-height: 1;
}

.top-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    font-weight: 700;
    border: 2px solid #fff;
}

.top-user-photo,
.top-user-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.top-user-photo {
    object-fit: cover;
}

.top-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.top-dropdown {
    position: absolute;
    top: 54px;
    left: 0;
    right: auto;
    width: 280px;
    max-width: calc(100vw - 24px);
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15,23,42,.16);
    overflow: hidden;
    z-index: 9999;
}

.top-dropdown.open {
    display: block;
}

.top-dropdown-title,
.user-menu-head {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.top-dropdown-title {
    font-weight: 800;
}

.user-menu-head strong,
.user-menu-head span {
    display: block;
}

.user-menu-head span {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.user-menu a,
.notification-item {
    display: block;
    padding: 12px 16px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.user-menu a:hover,
.notification-item:hover {
    background: #f8fafc;
}

.notification-item strong,
.notification-item span {
    display: block;
}

.notification-item strong {
    font-size: 14px;
}

.notification-item span,
.notification-empty {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.notification-empty {
    padding: 16px;
}

.profile-box {
    margin-bottom: 20px;
}

.profile-photo-wrap {
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
}

.signature-wrap {
    margin-top: 8px;
}

.signature-pad {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    display: block;
    margin-bottom: 8px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1200px) {
    .five-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .cards {
        grid-template-columns:repeat(2,1fr);
    }

    .grid-2 {
        grid-template-columns:1fr;
    }
}

@media (max-width: 768px) {
    .dashboard {
        display:block;
    }

    .sidebar {
        width:100%;
    }

    .main {
        padding:82px 14px 20px;
    }

    html.sidebar-hidden .main {
        padding-left:14px;
        padding-top:76px;
    }

    .cards {
        grid-template-columns:1fr;
    }

    .five-cards {
        grid-template-columns: 1fr;
    }

    .table-head {
        align-items:flex-start;
        flex-direction:column;
    }

    .table-wrap {
        overflow-x:auto;
    }

    .toolbar .form-control {
        min-width: 100%;
    }

    /* Icon notifikasi dan profil langsung kelihatan di HP */
    .top-actions {
        top: 14px;
        left: 62px;
        right: auto;
        gap: 8px;
    }

    .top-icon-btn,
    .user-toggle {
        width: 40px;
        height: 40px;
    }

    .top-user-photo,
    .top-user-initials {
        width: 40px;
        height: 40px;
    }

    .top-dropdown {
        top: 50px;
        left: 0;
        right: auto;
        width: 260px;
        max-width: calc(100vw - 20px);
    }

    .sidebar-show-toggle {
        top: 14px;
        left: 12px;
    }
}

/* FINAL OVERRIDE: sidebar show/hide khusus HP */
@media (max-width: 768px) {
    .dashboard {
        display: block;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: min(82vw, 300px) !important;
        max-width: 300px;
        height: 100vh;
        padding: 18px 14px 24px;
        overflow-y: auto;
        z-index: 9998;
        box-shadow: 18px 0 45px rgba(15, 23, 42, .28);
    }

    html.sidebar-hidden .sidebar {
        display: none !important;
    }

    .sidebar-show-toggle {
        display: inline-flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
        z-index: 10020;
        background: #0f172a;
        color: #fff;
    }

    html.sidebar-hidden .sidebar-show-toggle {
        display: inline-flex !important;
    }

    html:not(.sidebar-hidden) .sidebar-show-toggle {
        display: inline-flex !important;
        left: min(calc(82vw + 10px), 310px);
        background: rgba(15, 23, 42, .92);
    }

    .sidebar-hide-toggle {
        display: inline-flex;
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .sidebar h2 {
        font-size: 18px;
        padding-right: 42px;
    }

    .sidebar-user-box {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        padding: 0 42px 14px 0;
        margin-bottom: 14px;
    }

    .sidebar-user-photo {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .sidebar-user-name {
        margin-top: 0;
        font-size: 14px;
    }

    .sidebar a {
        min-height: 42px;
        padding: 9px 10px;
        font-size: 13px;
    }

    .main,
    html.sidebar-hidden .main {
        width: 100%;
        padding: 82px 14px 20px;
    }

    .top-actions {
        right: 8px;
        left: 62px;
        max-width: calc(100vw - 74px);
        justify-content: flex-end;
        z-index: 10000;
    }

    .academic-year-pill {
        max-width: calc(100vw - 190px);
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 11px;
        padding: 0 9px;
    }
}

@media (max-width: 420px) {
    .sidebar {
        width: 86vw !important;
        max-width: 286px;
    }
}

/* Sidebar drawer mobile */
@media (max-width: 768px) {
    .dashboard {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 300px);
        max-width: 300px;
        height: 100vh;
        padding: 18px 14px 24px;
        overflow-y: auto;
        z-index: 9998;
        box-shadow: 18px 0 45px rgba(15, 23, 42, .28);
    }

    html.sidebar-hidden .sidebar {
        display: none;
    }

    .sidebar h2 {
        font-size: 18px;
        margin-bottom: 14px;
        padding-right: 44px;
    }

    .sidebar-user-box {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
        margin-bottom: 14px;
        padding: 0 44px 14px 0;
    }

    .sidebar-user-photo {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .sidebar-user-name {
        margin-top: 0;
        font-size: 14px;
        line-height: 1.3;
    }

    .sidebar-user-role {
        font-size: 11px;
    }

    .sidebar-group {
        margin-top: 12px;
    }

    .sidebar-group-title {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .sidebar a {
        min-height: 42px;
        padding: 9px 10px;
        border-radius: 10px;
        font-size: 13px;
        margin-bottom: 5px;
    }

    .sidebar-icon {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }

    .sidebar-hide-toggle {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 22px;
    }

    .sidebar-show-toggle {
        display: inline-flex;
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
    }

    html:not(.sidebar-hidden) .sidebar-show-toggle {
        display: none;
    }

    .main,
    html.sidebar-hidden .main {
        width: 100%;
        padding: 82px 14px 20px;
    }
}

@media (max-width: 420px) {
    .sidebar {
        width: 86vw;
        max-width: 286px;
    }
}

@media (max-width: 420px) {
    .top-actions {
        left: 58px;
        gap: 6px;
    }

    .top-icon-btn,
    .user-toggle {
        width: 38px;
        height: 38px;
    }

    .top-user-photo,
    .top-user-initials {
        width: 38px;
        height: 38px;
    }

    .top-dropdown {
        width: 250px;
        max-width: calc(100vw - 16px);
    }

    .login-page {
        padding: 16px;
    }

    .login-head,
    .login-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* FIX: tetap di kanan tapi tidak keluar layar */
.top-actions {
    position: fixed;
    top: 14px;
    right: 14px; /* aman di layar */
    left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

/* Pastikan tidak ada scroll horizontal */
body {
    overflow-x: hidden;
}

/* Perbaikan dropdown agar tidak keluar layar */
.top-dropdown {
    right: 0;
    left: auto;
    max-width: calc(100vw - 20px);
}

/* MODE HP */
@media (max-width: 768px) {
    .top-actions {
        right: 10px; /* lebih ke dalam */
        left: auto;
        top: 12px;
        gap: 8px;
    }

    .top-icon-btn,
    .user-toggle {
        width: 40px;
        height: 40px;
    }

    .top-user-photo,
    .top-user-initials {
        width: 40px;
        height: 40px;
    }

    .top-dropdown {
        right: 0;
        left: auto;
        width: 260px;
        max-width: calc(100vw - 16px);
    }
}

/* HP kecil */
@media (max-width: 420px) {
    .top-actions {
        right: 8px;
        gap: 6px;
    }

    .top-icon-btn,
    .user-toggle {
        width: 38px;
        height: 38px;
    }
}
/* FIX UTAMA: cegah layout melebar di HP */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.dashboard,
.main,
.topbar,
.card,
.table-wrap,
.grid-2,
.cards,
.five-cards {
    max-width: 100%;
    min-width: 0;
}

/* Grid jangan memaksa melebar */
.grid-2 {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Semua isi grid boleh mengecil */
.grid-2 > *,
.cards > *,
.five-cards > * {
    min-width: 0;
}

/* Top icon tetap kanan layar, bukan kanan konten yang melebar */
.top-actions {
    position: fixed;
    top: 14px;
    right: 14px;
    left: auto;
    z-index: 9999;
}

/* Dropdown tetap masuk layar */
.top-dropdown {
    right: 0;
    left: auto;
    max-width: calc(100vw - 20px);
}

/* Table boleh scroll di dalam kotaknya saja */
.table-wrap {
    overflow-x: auto;
}

/* Media HP */
@media (max-width: 768px) {
    .main {
        width: 100%;
        max-width: 100%;
        padding: 82px 14px 20px;
        overflow-x: hidden;
    }

    .grid-2 {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    .top-actions {
        top: 12px;
        right: 10px;
        left: auto;
        gap: 8px;
    }

    .top-icon-btn,
    .user-toggle,
    .top-user-photo,
    .top-user-initials {
        width: 40px;
        height: 40px;
    }

    .top-dropdown {
        right: 0;
        left: auto;
        width: 260px;
        max-width: calc(100vw - 16px);
    }
}
