
/* =========================================================
   EabsensiMGM — COMPLETE APPLICATION STYLESHEET
   Login • Dashboard • Karyawan • Absensi • Lokasi • Form
========================================================= */

:root {
    --bg: #050b19;
    --bg2: #09152c;
    --panel: #0a1730;
    --panel2: #102344;
    --border: rgba(66, 139, 220, .3);
    --text: #eef5ff;
    --muted: #91a9ca;
    --cyan: #00d9ff;
    --blue: #168bff;
    --purple: #854bff;
    --green: #00e5a0;
    --orange: #ffae42;
    --pink: #ff4f9a;
    --red: #ff5878;
    --radius: 15px;
    --shadow: 0 15px 45px rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(0, 112, 255, .13), transparent 40%),
        radial-gradient(ellipse at 100% 85%, rgba(115, 43, 221, .11), transparent 36%),
        var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: #64dcff;
    text-decoration: none;
}

a:hover {
    color: #b8f4ff;
}

button {
    color: inherit;
}

img {
    max-width: 100%;
}

h1, h2, h3, p {
    overflow-wrap: anywhere;
}

[hidden] {
    display: none !important;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 26px 16px;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 12% 12%, rgba(0, 136, 255, .22), transparent 36%),
        radial-gradient(ellipse at 88% 82%, rgba(132, 63, 255, .19), transparent 36%),
        linear-gradient(135deg, #040918, #08152d 52%, #070b1b);
}

.login-page::before {
    position: fixed;
    z-index: -3;
    inset: 0;
    background-image:
        linear-gradient(rgba(73, 170, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(73, 170, 255, .055) 1px, transparent 1px);
    background-size: 38px 38px;
    content: "";
    pointer-events: none;
}

.login-page::after {
    position: fixed;
    z-index: -3;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, transparent, rgba(2, 6, 17, .42));
    content: "";
    pointer-events: none;
}

.login-page .login-orbit {
    position: fixed;
    z-index: -2;
    width: min(68vw, 570px);
    aspect-ratio: 1;
    border: 1px solid rgba(0, 217, 255, .15);
    border-radius: 50%;
    box-shadow: 0 0 75px rgba(0, 123, 255, .1), inset 0 0 65px rgba(0, 123, 255, .05);
    pointer-events: none;
    animation: mgmOrbitDrift 15s ease-in-out infinite alternate;
}

.login-page .orbit-one {
    top: -27%;
    right: -19%;
}

.login-page .orbit-two {
    bottom: -31%;
    left: -20%;
    border-color: rgba(139, 77, 255, .18);
    animation-delay: -6s;
}

.login-page .login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: clamp(23px, 5vw, 34px);
    overflow: hidden;
    border: 1px solid rgba(90, 190, 255, .3);
    border-radius: 25px;
    background: linear-gradient(145deg, rgba(15, 36, 73, .76), rgba(5, 13, 31, .88) 72%);
    -webkit-backdrop-filter: blur(28px) saturate(155%);
    backdrop-filter: blur(28px) saturate(155%);
    box-shadow: 0 28px 95px rgba(0, 0, 0, .5), 0 0 55px rgba(0, 123, 255, .12), inset 0 1px rgba(255, 255, 255, .08);
    animation: mgmLoginEnter .65s cubic-bezier(.2, .7, .2, 1) both;
}

.login-page .login-card::before {
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #53eaff, #8b70ff, transparent);
    content: "";
}

.login-page .login-card::after {
    position: absolute;
    top: -70px;
    right: -65px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(79, 201, 255, .09);
    border-radius: 50%;
    box-shadow: 0 0 0 20px rgba(79, 201, 255, .025), 0 0 0 42px rgba(79, 201, 255, .018);
    content: "";
    pointer-events: none;
}

.login-page .login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 23px;
    border-bottom: 1px solid rgba(61, 111, 164, .35);
}

.login-page .login-logo {
    position: relative;
    display: grid;
    flex: 0 0 49px;
    place-items: center;
    width: 49px;
    height: 49px;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(100, 231, 255, .45);
    border-radius: 15px;
    background: linear-gradient(145deg, #00d9ff, #246cff 56%, #8b4dff);
    box-shadow: 0 0 27px rgba(8, 125, 255, .35);
}

.login-page .login-logo span {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 24px;
    font-weight: 800;
}

.login-page .login-brand-name {
    color: #f5f9ff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.8px;
}

.login-page .login-brand-name span {
    color: var(--cyan);
}

.login-page .login-brand-sub {
    margin-top: 4px;
    color: #7597c2;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.login-page .login-intro {
    position: relative;
    z-index: 1;
    padding: 25px 0 19px;
}

.login-page .login-intro .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(0, 217, 255, .18);
    border-radius: 7px;
    background: rgba(0, 217, 255, .055);
    color: #91edff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.login-page .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(0, 230, 160, .9);
}

.login-page .login-intro h1 {
    margin: 14px 0 10px;
    color: #f4f8ff;
    font-size: clamp(29px, 7vw, 36px);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -1.4px;
}

.login-page .login-intro h1 span {
    color: var(--cyan);
}

.login-page .login-intro p {
    margin: 0;
    color: #91a9cb;
    font-size: 12px;
    line-height: 1.75;
}

.login-page .login-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 9px;
    text-align: left;
}

.login-page .login-form > label {
    margin: 5px 0 0;
    color: #b7cce8;
    font-size: 11px;
    font-weight: 600;
}

.login-page .login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid rgba(74, 116, 166, .45);
    border-radius: 11px;
    background: rgba(3, 13, 31, .48);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.login-page .login-input-wrap:focus-within {
    border-color: rgba(72, 224, 255, .75);
    background: rgba(8, 25, 49, .76);
    box-shadow: 0 0 0 3px rgba(0, 207, 255, .09), 0 0 20px rgba(0, 153, 255, .08);
}

.login-page .login-input-wrap input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    margin: 0;
    padding: 13px 44px 13px 43px;
    border: 0;
    border-radius: inherit;
    outline: none;
    background: transparent;
    color: #f1f7ff;
    font-size: 13px;
    box-shadow: none;
}

.login-page .login-input-wrap input::placeholder {
    color: #7189a9;
}

.login-page .login-input-wrap input:focus {
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
}

.login-page .input-icon {
    position: absolute;
    z-index: 1;
    left: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #70dfff;
    pointer-events: none;
}

.login-page .input-icon svg {
    display: block;
    width: 21px;
    height: 21px;
}

.login-page .password-toggle {
    position: absolute;
    z-index: 2;
    right: 7px;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #8eb8e8;
    cursor: pointer;
    transition: color .2s, background .2s;
}

.login-page .password-toggle svg {
    width: 21px;
    height: 21px;
}

.login-page .password-toggle:hover {
    background: rgba(0, 207, 255, .09);
    color: #62eaff;
}

.login-page .login-submit {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 60px;
    margin-top: 14px;
    padding: 8px 9px 8px 20px;
    overflow: hidden;
    border: 1px solid rgba(160, 239, 255, .48);
    border-radius: 16px;
    background: linear-gradient(115deg, #00c9f5, #087cff 42%, #554dff 72%, #963fff);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 24px rgba(0, 119, 255, .27), inset 0 1px rgba(255, 255, 255, .42);
    transition: transform .18s, box-shadow .22s, filter .22s;
}

.login-page .login-submit::after {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: -130%;
    width: 70%;
    transform: skewX(-25deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
    content: "";
    transition: left .7s;
    pointer-events: none;
}

.login-page .login-submit > span:first-child {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: left;
}

.login-page .login-submit .submit-arrow {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 13px;
    background: rgba(255, 255, 255, .2);
    color: white;
    font-size: 21px;
    transition: transform .2s, border-radius .2s;
}

@media (hover: hover) {
    .login-page .login-submit:hover {
        transform: translateY(-3px);
        filter: brightness(1.08) saturate(1.12);
        box-shadow: 0 14px 32px rgba(0, 119, 255, .36), 0 0 24px rgba(0, 217, 255, .2);
    }

    .login-page .login-submit:hover::after {
        left: 150%;
    }

    .login-page .login-submit:hover .submit-arrow {
        transform: translateX(2px);
        border-radius: 50%;
    }
}

.login-page .login-submit:active {
    transform: translateY(1px) scale(.975);
    filter: brightness(.94);
    transition-duration: 65ms;
}

.login-page .login-submit:focus-visible {
    outline: 2px solid #8af2ff;
    outline-offset: 4px;
}

.login-page .login-submit:disabled {
    cursor: not-allowed;
    opacity: .6;
    filter: grayscale(.3);
    transform: none;
}

.login-page .login-security {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 19px;
    padding: 12px;
    border: 1px solid rgba(31, 140, 125, .32);
    border-radius: 11px;
    background: rgba(0, 217, 154, .045);
}

.login-page .security-icon {
    display: grid;
    flex: 0 0 30px;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 217, 154, .24);
    border-radius: 9px;
    background: rgba(0, 217, 154, .1);
    color: #52f4c3;
}

.login-page .security-icon svg {
    width: 18px;
    height: 18px;
}

.login-page .login-security b,
.login-page .login-security small {
    display: block;
}

.login-page .login-security b {
    color: #d5fff1;
    font-size: 10px;
}

.login-page .login-security small {
    margin-top: 2px;
    color: #80a9b5;
    font-size: 9px;
    line-height: 1.6;
}

.login-page .login-company {
    position: relative;
    z-index: 1;
    margin-top: 25px;
    text-align: center;
}

.login-page .login-company .company-line {
    width: 48px;
    height: 1px;
    margin: 0 auto 13px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.login-page .login-company span,
.login-page .login-company small {
    display: block;
}

.login-page .login-company span {
    color: #8ca9d1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.login-page .login-company small {
    margin-top: 5px;
    color: #7189ad;
    font-size: 8px;
    letter-spacing: 1px;
}

/* =========================================================
   KERANGKA DASHBOARD
========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 220px;
    height: 100vh;
    height: 100dvh;
    padding: 20px 13px 15px;
    overflow-y: auto;
    border-right: 1px solid rgba(64, 131, 211, .25);
    background: rgba(4, 13, 31, .98);
    box-shadow: 10px 0 40px rgba(0, 0, 0, .12);
    transition: transform .25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    margin-bottom: 24px;
    padding: 3px 7px;
}

.brand-icon {
    display: grid;
    flex: 0 0 39px;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid rgba(119, 231, 255, .45);
    border-radius: 13px;
    background: linear-gradient(135deg, #00cfff, #276bff 55%, #8b48ff);
    color: white;
    font-size: 23px;
    font-weight: 800;
    box-shadow: 0 0 25px rgba(0, 131, 255, .3);
}

.brand b {
    display: block;
    color: #f3f8ff;
    font-size: 14px;
    letter-spacing: -.5px;
}

.brand b span {
    color: var(--cyan);
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #839cbd;
    font-size: 9px;
}

.side-label {
    margin: 12px 8px 9px;
    color: #58779f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    margin-bottom: 4px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #a9bfdd;
    font-size: 12px;
    font-weight: 600;
    transition: color .2s, background .2s, border-color .2s;
}

.nav-link > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    flex: 0 0 17px;
    color: #94b2d9;
    font-size: 16px;
}

.nav-link:hover {
    border-color: rgba(57, 151, 255, .25);
    background: rgba(31, 100, 190, .12);
    color: white;
}

.nav-link.active {
    border-color: rgba(49, 157, 255, .55);
    background: linear-gradient(110deg, rgba(0, 153, 255, .22), rgba(95, 65, 255, .22));
    color: white;
    box-shadow: inset 0 0 20px rgba(28, 109, 255, .07);
}

.nav-link.active > span {
    color: #62e7ff;
}

.sidebar-foot {
    margin-top: auto;
    padding: 28px 8px 2px;
    color: #52749f;
    font-size: 9px;
    line-height: 1.8;
    letter-spacing: 1px;
}

.sidebar-foot b {
    color: #8caed8;
}

.sidebar-foot small {
    display: block;
    margin-top: 7px;
    color: #496386;
    letter-spacing: 0;
}

.main-area {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    margin-left: 220px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 67px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(64, 131, 211, .2);
    background: rgba(5, 14, 32, .94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.topbar strong {
    display: block;
    color: #edf5ff;
    font-size: 14px;
    font-weight: 800;
}

.topbar small {
    display: block;
    margin-top: 2px;
    color: #7f9abb;
    font-size: 10px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.system-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(0, 229, 160, .27);
    border-radius: 30px;
    background: rgba(0, 229, 160, .06);
    color: #55edc1;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.system-pill i {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(0, 229, 160, .75);
}

.avatar-small {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: linear-gradient(135deg, #168fff, #8b48ff);
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.mobile-menu {
    display: none !important;
}

.page-content {
    flex: 1;
    min-width: 0;
    padding: 22px 24px;
}

.footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(65, 127, 193, .14);
    color: #607a9c;
    font-size: 10px;
    text-align: center;
}

/* =========================================================
   HERO TOWER DASHBOARD
   File gambar:
   assets/images/mgm-tower-dashboard.png
========================================================= */

.mgm-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 190px;
    margin-bottom: 16px;
    padding: 26px 25px;
    overflow: hidden;
    border: 1px solid rgba(55, 157, 255, .42);
    border-radius: 20px;
    background: #07152f;
    box-shadow: var(--shadow);
}

.mgm-hero-image,
.mgm-hero-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mgm-hero-image {
    z-index: -2;
    background-image: url("images/mgm-tower-dashboard.png");
    background-size: cover;
    background-position: center 47%;
    opacity: .85;
    transform: scale(1.015);
}

.mgm-hero-overlay {
    z-index: -1;
    background: linear-gradient(90deg, rgba(5, 16, 39, .97), rgba(5, 18, 43, .87) 34%, rgba(5, 17, 42, .45) 70%, rgba(7, 13, 39, .56));
}

.mgm-hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    max-width: 620px;
}

.mgm-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: #52e8ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.mgm-live-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(0, 229, 160, .8);
}

.mgm-hero-content h1 {
    margin: 0 0 9px;
    color: #f4f8ff;
    font-size: clamp(23px, 2.2vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.8px;
    text-shadow: 0 3px 18px rgba(0, 0, 0, .38);
}

.mgm-hero-content h1 span {
    color: #9edcff;
}

.mgm-hero-content p {
    max-width: 460px;
    margin: 0;
    color: #c1d7f5;
    font-size: 12px;
    line-height: 1.8;
}

.mgm-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 17px;
}

.mgm-hero-tags span {
    padding: 7px 10px;
    border: 1px solid rgba(90, 194, 255, .27);
    border-radius: 8px;
    background: rgba(6, 25, 55, .64);
    color: #c7e8ff;
    font-size: 9px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mgm-hero-time {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    flex-direction: column;
    gap: 7px;
    padding: 15px;
    border: 1px solid rgba(91, 184, 255, .23);
    border-radius: 14px;
    background: rgba(5, 17, 40, .65);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

.mgm-time-label {
    color: #8eafd9;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.mgm-hero-time strong {
    color: white;
    font-size: clamp(23px, 2.4vw, 31px);
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}

.mgm-hero-time small {
    color: #a9c2e3;
    font-size: 10px;
}

.mgm-system-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    padding: 7px 10px;
    border: 1px solid rgba(0, 226, 161, .25);
    border-radius: 20px;
    background: rgba(0, 226, 161, .07);
    color: #5af3c6;
    font-size: 9px;
    font-weight: 700;
}

.mgm-system-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

.mgm-hero-bottom {
    position: absolute;
    right: 25px;
    bottom: 10px;
    left: 25px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(166, 201, 244, .72);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.3px;
    pointer-events: none;
}

/* Banner lama jika masih digunakan halaman lain */

.welcome-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 134px;
    margin-bottom: 16px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(47, 135, 238, .42);
    border-radius: 18px;
    background: linear-gradient(120deg, #102950, #09152e 70%, #16113c);
    box-shadow: var(--shadow);
}

.welcome-panel h1 {
    margin: 9px 0 5px;
    color: #f1f7ff;
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.25;
}

.welcome-panel p {
    margin: 0;
    color: #a7c7ee;
    font-size: 12px;
}

.eyebrow {
    color: #4ce8ff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.welcome-time {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
}

.welcome-time small {
    color: #91b3df;
    font-size: 10px;
}

.welcome-time strong {
    color: white;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   STATISTIK
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 140px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(145deg, #102344, #09162e 80%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    transition: transform .2s, border-color .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(77, 186, 255, .55);
}

.stat-card::after {
    position: absolute;
    z-index: -1;
    top: -65px;
    right: -65px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--stat-glow, rgba(0, 156, 255, .32)), transparent 70%);
    content: "";
}

.stat-card.blue { --stat-glow: rgba(0, 126, 255, .42); }
.stat-card.green { --stat-glow: rgba(0, 230, 160, .36); }
.stat-card.pink { --stat-glow: rgba(255, 51, 142, .36); }
.stat-card.orange { --stat-glow: rgba(255, 162, 40, .38); }
.stat-card.purple { --stat-glow: rgba(130, 67, 255, .42); }
.stat-card.teal { --stat-glow: rgba(0, 211, 233, .38); }

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border: 1px solid rgba(71, 190, 255, .4);
    border-radius: 10px;
    background: rgba(0, 154, 255, .12);
    color: #65e3ff;
    font-size: 18px;
}

.stat-card.green .stat-icon { color: #52f3c2; border-color: rgba(0, 229, 160, .4); background: rgba(0, 229, 160, .09); }
.stat-card.pink .stat-icon { color: #ff77b3; border-color: rgba(255, 79, 154, .4); background: rgba(255, 79, 154, .09); }
.stat-card.orange .stat-icon { color: #ffc16e; border-color: rgba(255, 174, 66, .4); background: rgba(255, 174, 66, .09); }
.stat-card.purple .stat-icon { color: #b39aff; border-color: rgba(133, 77, 255, .4); background: rgba(133, 77, 255, .1); }
.stat-card.teal .stat-icon { color: #55efff; border-color: rgba(0, 217, 255, .4); background: rgba(0, 217, 255, .09); }

.stat-label {
    color: #a7c4e8;
    font-size: 11px;
}

.stat-card > strong {
    margin-top: 3px;
    color: #f4f8ff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.stat-card > small {
    margin-top: 6px;
    color: #7ca4d6;
    font-size: 10px;
}

/* =========================================================
   PANEL, GRID, GRAFIK
========================================================= */

.content-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.content-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    min-width: 0;
    margin-bottom: 14px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(12, 29, 57, .98), rgba(7, 18, 39, .98));
    box-shadow: 0 9px 26px rgba(0, 0, 0, .12);
}

.content-grid .panel {
    height: 100%;
    margin-bottom: 0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
    color: #e8f2ff;
    font-size: 14px;
    font-weight: 800;
}

.panel-head p {
    margin: 4px 0 0;
    color: #809bbd;
    font-size: 10px;
}

.tag {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(0, 217, 255, .3);
    border-radius: 6px;
    background: rgba(0, 217, 255, .07);
    color: #53e8ff;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.text-link {
    color: #54dcff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.muted { color: var(--muted); }
.tiny { font-size: 10px; }

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    min-height: 175px;
    padding-top: 5px;
    border-bottom: 1px solid rgba(100, 149, 204, .2);
}

.bar-item {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    height: 100%;
}

.bar-item > strong {
    color: #a9c8ef;
    font-size: 10px;
}

.bar-track {
    display: flex;
    align-items: flex-end;
    width: min(100%, 27px);
    height: 115px;
    overflow: hidden;
    border-radius: 8px 8px 2px 2px;
    background: rgba(46, 86, 136, .32);
}

.bar-track i {
    display: block;
    width: 100%;
    min-height: 3px;
    border-radius: 7px 7px 2px 2px;
    background: linear-gradient(180deg, #51eaff, #1587ff 65%, #6750ff);
    box-shadow: 0 0 13px rgba(0, 163, 255, .25);
    transition: height .4s;
}

.bar-item small {
    color: #819fc3;
    font-size: 9px;
    white-space: nowrap;
}

/* Donut */

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    min-height: 175px;
}

.donut {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 132px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: conic-gradient(#00dca6 0 var(--pct, 0%), #263d5f var(--pct, 0%) 100%);
}

.donut::before {
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(112, 164, 223, .12);
    border-radius: 50%;
    background: #0b1a35;
    content: "";
}

.donut > div {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.donut strong {
    color: white;
    font-size: 21px;
    font-weight: 800;
}

.donut small {
    color: #90aaca;
    font-size: 9px;
}

.legend {
    display: grid;
    gap: 13px;
    min-width: 0;
}

.legend > span {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: #a4bbd9;
    font-size: 10px;
}

.legend b {
    color: #eef5ff;
    font-size: 11px;
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.dot.green { background: #00e5a0; }
.dot.orange { background: #ffae42; }
.dot.gray { background: #7188a7; }
.dot.red { background: #ff547f; }

/* =========================================================
   MAP, LEAFLET, AKTIVITAS
========================================================= */

.map-box {
    position: relative;
    z-index: 0;
    width: 100%;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid rgba(71, 143, 211, .3);
    border-radius: 12px;
    background: linear-gradient(135deg, #0b2746, #051227);
}

.map-box:empty::before {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 20px;
    color: #7c9cbe;
    font-size: 11px;
    text-align: center;
    content: "Peta akan ditampilkan jika integrasi lokasi sudah aktif.";
}

.leaflet-container {
    z-index: 0;
    font-family: inherit;
    background: #0b1b32;
}

.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(86, 132, 188, .15);
}

.activity-row:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 5px;
    border: 2px solid rgba(0, 217, 255, .35);
    border-radius: 50%;
    background: #29dfff;
    box-shadow: 0 0 10px rgba(0, 217, 255, .4);
}

.activity-row > div {
    min-width: 0;
}

.activity-row b {
    color: #e4efff;
    font-size: 11px;
}

.activity-row p {
    margin: 3px 0;
    color: #9bb3d2;
    font-size: 10px;
}

.activity-row small {
    color: #708aaa;
    font-size: 9px;
}
/* =====================================================
   MGM NETWORK COMMAND CENTER — MAP DESIGN
   File: assets/style.css
   Target: dashboard #admin-map
===================================================== */

.panel:has(#admin-map) {
    position: relative;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(53, 171, 255, .34);
    border-radius: 20px;

    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(0, 191, 255, .11),
            transparent 42%
        ),
        linear-gradient(145deg, #0c1c36, #071226 75%);

    box-shadow:
        0 16px 42px rgba(0, 0, 0, .2),
        inset 0 1px 0 rgba(255, 255, 255, .035);
}

/* Judul panel */
.panel:has(#admin-map) .panel-head {
    align-items: center;
    margin-bottom: 17px;
}

.panel:has(#admin-map) .panel-head h2 {
    color: #edf8ff;
    font-size: 15px;
    letter-spacing: -.3px;
}

.panel:has(#admin-map) .panel-head p {
    margin-top: 5px;
    color: #8ba9cb;
}

/* Bingkai peta futuristik */
#admin-map.map-box {
    position: relative;
    width: 100%;
    height: 360px;
    min-height: 360px;
    overflow: hidden;
    isolation: isolate;

    border: 1px solid rgba(57, 198, 255, .48);
    border-radius: 17px;

    background:
        radial-gradient(
            ellipse at center,
            rgba(0, 157, 255, .12),
            transparent 70%
        ),
        #061329;

    box-shadow:
        0 0 0 4px rgba(25, 137, 255, .045),
        0 14px 35px rgba(0, 0, 0, .26),
        inset 0 0 28px rgba(0, 172, 255, .055);

    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}

/* Garis neon tipis pada bagian atas peta */
#admin-map.map-box::before {
    position: absolute;
    z-index: 500;
    top: 0;
    left: 12%;
    width: 76%;
    height: 1px;
    pointer-events: none;
    content: "";

    background: linear-gradient(
        90deg,
        transparent,
        #36ddff,
        #6389ff,
        transparent
    );

    box-shadow: 0 0 12px rgba(0, 217, 255, .6);
}

#admin-map.map-box:hover {
    border-color: rgba(66, 221, 255, .7);

    box-shadow:
        0 0 0 4px rgba(25, 137, 255, .06),
        0 16px 38px rgba(0, 0, 0, .3),
        0 0 22px rgba(0, 191, 255, .075);
}

/* Leaflet memenuhi seluruh bingkai */
#admin-map .leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
    background: #07152b;
}

/* Peta tetap jelas, tidak dibuat terlalu gelap */
#admin-map .leaflet-tile {
    filter: saturate(.9) contrast(1.02);
}

/* Kontrol zoom bergaya glass */
#admin-map .leaflet-control-zoom {
    margin: 13px !important;
    overflow: hidden;

    border: 1px solid rgba(67, 205, 255, .48) !important;
    border-radius: 11px !important;

    background: rgba(5, 20, 40, .92) !important;
    box-shadow:
        0 8px 22px rgba(0, 0, 0, .28),
        0 0 14px rgba(0, 195, 255, .07) !important;
}

#admin-map .leaflet-control-zoom a {
    display: block;
    width: 36px !important;
    height: 36px !important;
    line-height: 35px !important;

    color: #8feaff !important;
    background: rgba(7, 24, 47, .96) !important;
    border-color: rgba(67, 205, 255, .17) !important;

    font-size: 21px !important;
    transition:
        background .2s ease,
        color .2s ease;
}

#admin-map .leaflet-control-zoom a:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #087eb8, #285de0) !important;
}

/* Atribusi peta */
#admin-map .leaflet-control-attribution {
    padding: 5px 8px;
    color: #a9c6e3 !important;
    background: rgba(5, 16, 33, .91) !important;
    border-top-left-radius: 9px;
    font-size: 9px !important;
    backdrop-filter: blur(10px);
}

#admin-map .leaflet-control-attribution a {
    color: #5ce4ff !important;
}

/* Popup lokasi */
#admin-map .leaflet-popup-content-wrapper {
    color: #eaf6ff;
    background: linear-gradient(145deg, #102644, #09172d);
    border: 1px solid rgba(57, 198, 255, .45);
    border-radius: 13px;

    box-shadow:
        0 14px 35px rgba(0, 0, 0, .35),
        0 0 18px rgba(0, 191, 255, .06);
}

#admin-map .leaflet-popup-tip {
    background: #0c203b;
}

#admin-map .leaflet-popup-content {
    margin: 13px 16px;
    line-height: 1.7;
}

#admin-map .leaflet-popup-close-button {
    color: #78e4ff !important;
}

/* Keterangan bawah peta */
.panel:has(#admin-map) > .muted {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 13px 2px 0;

    color: #89a9ca;
    font-size: 10px;
    line-height: 1.8;
}

/* Tablet */
@media (max-width: 900px) {
    #admin-map.map-box {
        height: 310px;
        min-height: 310px;
    }
}

/* Ponsel */
@media (max-width: 520px) {
    .panel:has(#admin-map) {
        padding: 13px;
        border-radius: 16px;
    }

    #admin-map.map-box {
        height: 255px;
        min-height: 255px;
        border-radius: 13px;
    }

    #admin-map .leaflet-control-zoom {
        margin: 8px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #admin-map.map-box {
        transition: none;
    }
}

/* =========================================================
   TABEL DAN STATUS
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(75, 130, 192, .19);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #c4d5ec;
    font-size: 11px;
    text-align: left;
}

thead {
    background: rgba(36, 77, 128, .24);
}

th {
    padding: 12px;
    color: #8faed5;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    padding: 12px;
    border-top: 1px solid rgba(82, 131, 186, .13);
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(42, 109, 190, .09);
}

td b,
td small {
    display: block;
}

td b {
    color: #e5f0ff;
    font-size: 11px;
}

td small {
    margin-top: 3px;
    color: #7999bd;
    font-size: 9px;
}

.empty {
    padding: 22px 12px !important;
    color: #829bbb;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.success { border-color: rgba(0, 229, 160, .25); background: rgba(0, 229, 160, .09); color: #57edbf; }
.badge.warning { border-color: rgba(255, 174, 66, .27); background: rgba(255, 174, 66, .1); color: #ffc36c; }
.badge.info { border-color: rgba(0, 190, 255, .27); background: rgba(0, 190, 255, .1); color: #69dcff; }
.badge.danger { border-color: rgba(255, 76, 112, .27); background: rgba(255, 76, 112, .1); color: #ff8da5; }

/* =========================================================
   PERJALANAN
========================================================= */

.travel-list {
    display: grid;
}

.travel-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(82, 131, 186, .15);
}

.travel-item:last-child {
    border-bottom: 0;
}

.travel-pin {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(0, 194, 255, .3);
    border-radius: 10px;
    background: rgba(0, 145, 255, .1);
    color: #65e7ff;
    font-size: 17px;
}

.travel-item > div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.travel-item b {
    color: #e6f0ff;
    font-size: 11px;
}

.travel-item p {
    margin: 4px 0;
    color: #94b1d3;
    font-size: 10px;
}

.travel-item small {
    color: #7896b8;
    font-size: 9px;
}

/* =========================================================
   FORMULIR HALAMAN LAIN
========================================================= */

form {
    min-width: 0;
}

label {
    color: #b9cce5;
    font-size: 11px;
    font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(77, 126, 181, .36);
    border-radius: 9px;
    outline: none;
    background: rgba(3, 13, 30, .62);
    color: #edf5ff;
    font-size: 12px;
    transition: border-color .2s, box-shadow .2s;
}

input::placeholder,
textarea::placeholder {
    color: #6f88a8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 217, 255, .65);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, .08);
}

select option {
    background: #0b1931;
    color: white;
}

textarea {
    min-height: 95px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #168fff;
}

input[type="file"] {
    max-width: 100%;
    color: #9cb5d4;
    font-size: 11px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 9px 14px;
    border: 1px solid rgba(77, 166, 255, .35);
    border-radius: 9px;
    background: linear-gradient(110deg, #087fe7, #584bfa);
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: transform .18s, filter .18s;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

.btn:active {
    transform: scale(.98);
}

.btn-secondary {
    border-color: rgba(111, 149, 195, .3);
    background: rgba(56, 91, 136, .2);
    color: #c6dcf7;
}

.btn-danger {
    border-color: rgba(255, 76, 112, .3);
    background: rgba(255, 76, 112, .12);
    color: #ff8da5;
}

.alert {
    margin-bottom: 15px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 190, 255, .3);
    border-radius: 10px;
    background: rgba(0, 145, 255, .09);
    color: #bfeeff;
    font-size: 12px;
}

/* =========================================================
   ANIMASI
========================================================= */

@keyframes mgmLoginEnter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes mgmOrbitDrift {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(18px, 16px, 0) rotate(5deg); }
}

/* =========================================================
   RESPONSIVE TABLET
========================================================= */

@media (max-width: 1100px) {
    .sidebar {
        width: 205px;
    }

    .main-area {
        margin-left: 205px;
    }

    .page-content {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .donut-wrap {
        gap: 15px;
    }

    .donut {
        width: 112px;
        height: 112px;
        flex-basis: 112px;
    }
}

/* =========================================================
   RESPONSIVE HP
========================================================= */

@media (max-width: 760px) {
    .sidebar {
        width: 260px;
        max-width: 84vw;
        transform: translateX(-105%);
        box-shadow: 20px 0 55px rgba(0, 0, 0, .45);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        min-height: 60px;
        gap: 10px;
        padding: 10px 14px;
    }

    .mobile-menu {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        padding: 0;
        border: 1px solid rgba(72, 151, 233, .3);
        border-radius: 10px;
        background: rgba(30, 91, 166, .16);
        color: #e8f6ff;
        cursor: pointer;
    }

    .topbar strong {
        font-size: 12px;
    }

    .topbar small {
        max-width: 165px;
        overflow: hidden;
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-right {
        gap: 7px;
    }

    .topbar .system-pill {
        padding: 6px 8px;
        font-size: 9px;
    }

    .avatar-small {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
    }

    .page-content {
        padding: 13px;
    }

    .footer {
        padding: 14px;
    }

    .welcome-panel,
    .mgm-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        padding: 20px 17px 40px;
    }

    .welcome-panel h1,
    .mgm-hero-content h1 {
        font-size: 23px;
    }

    .welcome-time {
        align-items: flex-start;
    }

    .welcome-time strong {
        font-size: 21px;
    }

    .mgm-hero-image {
        background-position: 62% center;
    }

    .mgm-hero-overlay {
        background: linear-gradient(90deg, rgba(5, 16, 39, .96), rgba(5, 18, 43, .7));
    }

    .mgm-hero-time {
        align-items: flex-start;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .stat-card {
        min-height: 130px;
        padding: 13px;
    }

    .stat-card > strong {
        font-size: 23px;
    }

    .content-grid.two {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .panel {
        padding: 14px;
        border-radius: 13px;
    }

    .donut-wrap {
        gap: 22px;
    }

    .chart-bars {
        gap: 8px;
    }

    .bar-track {
        width: min(100%, 25px);
        height: 95px;
    }

    .map-box {
        min-height: 220px;
    }

    th,
    td {
        padding: 10px;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 20px 14px;
    }

    .login-page .login-card {
        width: min(100%, 410px);
        padding: 25px 21px 22px;
        border-radius: 22px;
    }

    .login-page .login-brand {
        gap: 11px;
        padding-bottom: 21px;
    }

    .login-page .login-logo {
        flex-basis: 45px;
        width: 45px;
        height: 45px;
    }

    .login-page .login-brand-name {
        font-size: 19px;
    }

    .login-page .login-brand-sub {
        font-size: 7px;
        letter-spacing: 1.25px;
    }

    .login-page .login-intro {
        padding: 23px 0 17px;
    }

    .login-page .login-intro h1 {
        font-size: 30px;
    }

    .login-page .login-input-wrap input {
        min-height: 49px;
        font-size: 16px;
    }

    .login-page .login-submit {
        min-height: 56px;
        padding-left: 17px;
        border-radius: 14px;
    }

    .login-page .login-submit .submit-arrow {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .login-page .login-orbit {
        opacity: .7;
    }

    .mgm-hero {
        min-height: 300px;
    }

    .mgm-hero-time {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 9px 11px;
    }

    .mgm-time-label {
        display: none;
    }

    .mgm-hero-time strong {
        font-size: 19px;
    }

    .mgm-hero-time small {
        font-size: 9px;
    }

    .mgm-system-status {
        margin-top: 0;
    }

    .mgm-hero-bottom {
        right: 17px;
        left: 17px;
        flex-direction: column;
        gap: 4px;
        font-size: 7px;
    }
}

@media (max-width: 390px) {
    .page-content {
        padding: 10px;
    }

    .topbar {
        padding-right: 10px;
        padding-left: 10px;
    }

    .topbar .system-pill {
        font-size: 8px;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        padding: 11px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-card > strong {
        font-size: 21px;
    }

    .donut-wrap {
        flex-direction: column;
        padding: 10px 0;
    }

    .legend {
        width: 100%;
    }

    .login-page .login-card {
        padding: 22px 17px 19px;
        border-radius: 20px;
    }

    .login-page .login-intro {
        padding-top: 20px;
    }

    .login-page .login-intro h1 {
        font-size: 28px;
    }

    .login-page .login-intro .eyebrow {
        font-size: 8px;
        letter-spacing: .8px;
    }

    .login-page .login-input-wrap input {
        min-height: 47px;
        font-size: 15px;
    }
}

/* Aksesibilitas */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* =====================================================
   MGM FUTURISTIC MAP INTERFACE
===================================================== */

.mgm-map-container {
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(67, 190, 255, 0.25);
    border-radius: 16px;
    background: #071529;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.mgm-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px;
    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(0, 190, 255, 0.12),
            transparent 45%
        ),
        linear-gradient(135deg, #0b2039, #10172f);
    border-bottom: 1px solid rgba(92, 190, 255, 0.17);
}

.mgm-map-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mgm-map-status strong,
.mgm-map-status small {
    display: block;
}

.mgm-map-status strong {
    color: #e5f7ff;
    font-size: 11px;
    letter-spacing: 1.5px;
}

.mgm-map-status small {
    margin-top: 4px;
    color: #829dbd;
    font-size: 9px;
    letter-spacing: 0.7px;
}

.mgm-map-live-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #35edb0;
    box-shadow: 0 0 12px rgba(53, 237, 176, 0.8);
}

.mgm-map-modes {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(110, 190, 255, 0.16);
    border-radius: 11px;
    background: rgba(2, 12, 27, 0.72);
}

.mgm-map-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #9db8d6;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.mgm-map-mode span {
    font-size: 14px;
}

.mgm-map-mode:hover {
    color: #effbff;
    background: rgba(61, 175, 255, 0.12);
}

.mgm-map-mode.is-active {
    color: #ffffff;
    border-color: rgba(74, 202, 255, 0.4);
    background: linear-gradient(135deg, #157ab5, #5145a9);
    box-shadow: 0 0 16px rgba(40, 170, 255, 0.2);
}

.mgm-map-mode:focus-visible {
    outline: 2px solid #54d8ff;
    outline-offset: 2px;
}

.mgm-map-container #admin-map {
    width: 100%;
    min-height: 300px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}

.mgm-map-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 13px;
    border-top: 1px solid rgba(92, 190, 255, 0.12);
    background: #09172a;
    color: #8eaccb;
    font-size: 10px;
}

.mgm-map-caption > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.mgm-map-caption-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #35edb0;
    box-shadow: 0 0 8px rgba(53, 237, 176, 0.6);
}

.mgm-map-system {
    color: #5e83a9;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

@media (max-width: 480px) {
    .mgm-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .mgm-map-modes {
        width: 100%;
        box-sizing: border-box;
    }

    .mgm-map-mode {
        flex: 1;
        padding: 9px 5px;
    }

    .mgm-map-container #admin-map {
        min-height: 260px;
    }
}

/* =====================================================
   DASHBOARD — BALANCED MONITORING GRID
===================================================== */

.mgm-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.mgm-content-grid > .mgm-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mgm-map-container {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mgm-map-container #admin-map {
    display: block;
    width: 100%;
    height: 320px;
    min-height: 260px;
    box-sizing: border-box;
}

.mgm-map-toolbar {
    align-items: center;
    gap: 10px;
}

.mgm-map-modes {
    max-width: 100%;
    box-sizing: border-box;
}

.mgm-map-mode {
    min-width: 0;
}

@media (max-width: 900px) {
    .mgm-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mgm-map-container #admin-map {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .mgm-content-grid {
        gap: 12px;
    }

    .mgm-map-container #admin-map {
        height: 260px;
    }

    .mgm-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .mgm-map-modes {
        width: 100%;
    }

    .mgm-map-mode {
        flex: 1;
        padding: 8px 4px;
    }
}

/* =====================================================
   MGM MODERN SVG ICON SYSTEM
===================================================== */

.mgm-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    transition:
        color .2s ease,
        transform .2s ease,
        filter .2s ease;
}

/* SIDEBAR ICON */

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(107, 178, 255, .12);
    border-radius: 10px;
    color: #8caed5;
    background: rgba(19, 43, 77, .48);
    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.sidebar .nav-link:hover .nav-icon {
    color: #62e4ff;
    border-color: rgba(63, 205, 255, .38);
    background: rgba(24, 113, 174, .2);
    transform: translateY(-1px);
}

.sidebar .nav-link.active .nav-icon {
    color: #6ceaff;
    border-color: rgba(69, 203, 255, .42);
    background: linear-gradient(
        145deg,
        rgba(19, 151, 221, .25),
        rgba(91, 75, 218, .24)
    );
    box-shadow: 0 0 16px rgba(31, 166, 255, .12);
}

.sidebar .nav-link.active .nav-icon .mgm-icon {
    filter: drop-shadow(0 0 4px rgba(69, 218, 255, .35));
}

.sidebar .nav-text {
    min-width: 0;
}

/* IKON TOMBOL HEADER */

.topbar .icon-btn .mgm-icon {
    width: 19px;
    height: 19px;
}

/* IKON KARTU STATISTIK */

.mgm-stats .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(103, 194, 255, .22);
    border-radius: 14px;
    background: linear-gradient(
        145deg,
        rgba(32, 102, 162, .22),
        rgba(87, 69, 181, .16)
    );
    color: #62dfff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.mgm-stats .stat-icon .mgm-icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
    stroke-width: 1.9;
}

.mgm-stats .stat-card.green .stat-icon {
    color: #43efb3;
    border-color: rgba(67, 239, 179, .25);
}

.mgm-stats .stat-card.pink .stat-icon {
    color: #ff80b5;
    border-color: rgba(255, 128, 181, .25);
}

.mgm-stats .stat-card.orange .stat-icon {
    color: #ffbd70;
    border-color: rgba(255, 189, 112, .25);
}

.mgm-stats .stat-card.purple .stat-icon {
    color: #b7a0ff;
    border-color: rgba(183, 160, 255, .25);
}

.mgm-stats .stat-card.teal .stat-icon {
    color: #58e7e2;
    border-color: rgba(88, 231, 226, .25);
}

.mgm-stats .stat-card:hover .stat-icon {
    transform: translateY(-2px);
}

/* AKSESIBILITAS */

.sidebar .nav-link:focus-visible,
.topbar .icon-btn:focus-visible {
    outline: 2px solid #52dcff;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .sidebar .nav-link {
        gap: 10px;
    }

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

    .mgm-stats .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mgm-icon,
    .sidebar .nav-icon,
    .mgm-stats .stat-icon {
        transition: none !important;
    }
}

/* =====================================================
   FIX SIDEBAR MGM — ICON DAN TEKS MENU
===================================================== */

/* Lebar sidebar konsisten */
.sidebar {
    width: 244px;
    box-sizing: border-box;
    padding: 22px 14px;
}

/* Susunan ikon dan teks */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 9px 10px;
    white-space: nowrap;
}

/* Aturan khusus ikon: tidak ikut aturan span lama */
.sidebar .nav-link > .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    height: 32px;
    box-sizing: border-box;
    text-align: center;
    font-size: initial;
}

/* FIX UTAMA: teks tidak boleh dibatasi menjadi 22px */
.sidebar .nav-link > .nav-text {
    display: block;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ukuran SVG seragam */
.sidebar .nav-icon .mgm-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

/* Jarak bagian menu */
.sidebar .side-label {
    flex: 0 0 auto;
    padding: 12px 10px 8px;
}

.sidebar .brand {
    flex: 0 0 auto;
    min-width: 0;
}

.sidebar .brand > span:last-child {
    min-width: 0;
}

.sidebar .brand b,
.sidebar .brand small {
    white-space: nowrap;
}

/* Footer selalu berada di bawah */
.sidebar .sidebar-foot {
    flex: 0 0 auto;
    margin-top: auto;
}

/* Area konten mengikuti lebar sidebar */
.main-area {
    margin-left: 244px;
    min-width: 0;
}

/* Responsif untuk tablet dan ponsel */
@media (max-width: 900px) {
    .sidebar {
        width: 244px;
    }

    .main-area {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .sidebar .nav-link {
        padding: 9px 10px;
    }

    .sidebar .nav-link > .nav-text {
        font-size: 13px;
    }
}

/* ==========================================
   MGM LOGIN — RAPAPIKAN IKON DAN TEKS
========================================== */

/* Input login memiliki jarak teks yang konsisten */
body.login-page input:not([type="checkbox"]):not([type="radio"]) {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 14px !important;
    line-height: normal;
}

/* Hilangkan ikon pengguna yang bertumpuk pada input pertama */
body.login-page .input-icon,
body.login-page .user-icon,
body.login-page .username-icon {
    display: none !important;
}

/* Pembungkus input tidak perlu menyediakan ruang ikon kiri */
body.login-page .input-wrap input,
body.login-page .input-group input,
body.login-page .form-input-wrap input,
body.login-page .input-with-icon input {
    padding-left: 14px !important;
}

/* Ikon mata password tetap berada di kanan */
body.login-page .password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    transform: translateY(-50%);
    z-index: 3;
}

/* Input password menyediakan ruang untuk ikon mata */
body.login-page input[type="password"],
body.login-page input[type="text"].password-input {
    padding-right: 42px !important;
}

/* Ikon tombol masuk rapi dan tidak bergeser */
body.login-page button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Jarak label dan kolom input */
body.login-page label {
    display: block;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ==========================================
   LOGO EABSENSI MGM — LOGIN
========================================== */

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border: 1px solid rgba(69, 207, 255, .35);
    border-radius: 14px;
    background: #07152c;
    box-shadow: 0 0 18px rgba(0, 174, 255, .16);
}

.login-logo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.login-brand-text strong {
    color: #f1f7ff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.5px;
    white-space: nowrap;
}

.login-brand-text strong span {
    color: #00d9ff;
}

.login-brand-text small {
    color: #7898bf;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

@media (max-width: 480px) {
    .login-logo {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    .login-brand-text strong {
        font-size: 16px;
    }
}

/* =========================================================
   EABSENSIMGM LIGHT MODE — ADD-ON OVERRIDES
   Dark Mode tetap menjadi default. Aktif saat html[data-theme="light"]
   Tidak mengubah struktur HTML atau fungsi PHP/JavaScript.
========================================================= */
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f7fc;
    --bg2: #edf3fb;
    --panel: #ffffff;
    --panel2: #f7faff;
    --border: rgba(44, 105, 176, .17);
    --text: #182b45;
    --muted: #687b94;
    --cyan: #087fc4;
    --blue: #1677e8;
    --purple: #7650df;
    --green: #07966e;
    --orange: #b96b08;
    --pink: #c53d7e;
    --red: #d83d58;
    --shadow: 0 12px 32px rgba(34, 66, 108, .09);
    background: var(--bg);
    color: var(--text);
}

html[data-theme="light"] body {
    background:
        radial-gradient(ellipse at 12% 0%, rgba(22, 119, 232, .06), transparent 42%),
        radial-gradient(ellipse at 100% 85%, rgba(118, 80, 223, .045), transparent 38%),
        var(--bg);
    color: var(--text);
}

html[data-theme="light"] a { color: #176fc4; }
html[data-theme="light"] a:hover { color: #084f9d; }
html[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, .97);
    border-right-color: #e0e9f4;
    box-shadow: 8px 0 28px rgba(35, 68, 110, .045);
}
html[data-theme="light"] .brand b,
html[data-theme="light"] .topbar strong { color: #172b46; }
html[data-theme="light"] .brand small,
html[data-theme="light"] .topbar small { color: #72839b; }
html[data-theme="light"] .side-label { color: #8495ab; }
html[data-theme="light"] .nav-link { color: #4c607b; }
html[data-theme="light"] .nav-link > span { color: #6884a6; }
html[data-theme="light"] .nav-link:hover {
    border-color: rgba(22, 119, 232, .14);
    background: #f0f6ff;
    color: #145fae;
}
html[data-theme="light"] .nav-link.active {
    border-color: rgba(22, 119, 232, .18);
    background: linear-gradient(110deg, #e7f3ff, #f0edff);
    color: #145fae;
    box-shadow: none;
}
html[data-theme="light"] .nav-link.active > span { color: #1677e8; }
html[data-theme="light"] .sidebar-foot { color: #8597ad; }
html[data-theme="light"] .sidebar-foot b { color: #536c8b; }
html[data-theme="light"] .sidebar-foot small { color: #91a0b4; }
html[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, .92);
    border-bottom-color: #e3ebf5;
    box-shadow: 0 4px 18px rgba(35, 68, 110, .035);
}
html[data-theme="light"] .footer { color: #7c8da3; border-top-color: #e3ebf5; }
html[data-theme="light"] .system-pill { color: #087d60; background: #e9fbf4; border-color: #c8f0e2; }
html[data-theme="light"] .system-pill i { background: #0ba779; box-shadow: 0 0 8px rgba(11, 167, 121, .25); }

/* Kartu statistik dan panel */
html[data-theme="light"] .stat-card {
    background: linear-gradient(145deg, #ffffff, #f9fbff 90%);
    border-color: #e0e9f4;
    box-shadow: 0 8px 24px rgba(34, 66, 108, .055);
}
html[data-theme="light"] .stat-card:hover { border-color: #b7d7fa; }
html[data-theme="light"] .stat-label { color: #647992; }
html[data-theme="light"] .stat-card > strong { color: #172b46; }
html[data-theme="light"] .stat-card > small { color: #7288a3; }
html[data-theme="light"] .stat-icon { background: #eaf4ff; border-color: #cfe5ff; color: #1677e8; }
html[data-theme="light"] .stat-card.green .stat-icon { color: #078b68; border-color: #c4f0e1; background: #e8fbf4; }
html[data-theme="light"] .stat-card.pink .stat-icon { color: #c53d7e; border-color: #f4d2e3; background: #fff0f7; }
html[data-theme="light"] .stat-card.orange .stat-icon { color: #a96106; border-color: #f5dfbd; background: #fff7e9; }
html[data-theme="light"] .stat-card.purple .stat-icon { color: #7650df; border-color: #e1d7ff; background: #f4f0ff; }
html[data-theme="light"] .stat-card.teal .stat-icon { color: #087e9d; border-color: #c6edf5; background: #eafaff; }
html[data-theme="light"] .panel {
    background: linear-gradient(145deg, #ffffff, #fbfdff);
    border-color: #e0e9f4;
    box-shadow: 0 8px 25px rgba(34, 66, 108, .05);
}
html[data-theme="light"] .panel-head h2 { color: #1b304c; }
html[data-theme="light"] .panel-head p,
html[data-theme="light"] .muted { color: #6e8098; }
html[data-theme="light"] .tag { color: #0875b7; border-color: #c9e8fb; background: #eef9ff; }
html[data-theme="light"] .text-link { color: #176fc4; }
html[data-theme="light"] .bar-item > strong { color: #425d7e; }
html[data-theme="light"] .bar-track { background: #e8eff8; }
html[data-theme="light"] .bar-item small { color: #72869f; }
html[data-theme="light"] .donut::before { background: #ffffff; border-color: #e7edf5; }
html[data-theme="light"] .donut strong { color: #1b304c; }
html[data-theme="light"] .donut small { color: #72839a; }
html[data-theme="light"] .legend > span { color: #5c718b; }
html[data-theme="light"] .legend b { color: #243b59; }

/* Banner dashboard: pertahankan foto tower, cerahkan lapisan teks */
html[data-theme="light"] .welcome-panel {
    border-color: #d7e6f7;
    background: linear-gradient(120deg, #ffffff, #f0f6ff 70%, #f5f1ff);
    box-shadow: var(--shadow);
}
html[data-theme="light"] .welcome-panel h1 { color: #183452; }
html[data-theme="light"] .welcome-panel p { color: #5d7390; }
html[data-theme="light"] .eyebrow { color: #087fc4; }
html[data-theme="light"] .welcome-time small { color: #7187a1; }
html[data-theme="light"] .welcome-time strong { color: #173655; }
html[data-theme="light"] .mgm-hero { border-color: #cfe0f4; box-shadow: var(--shadow); }
html[data-theme="light"] .mgm-hero-overlay {
    background: linear-gradient(90deg, rgba(245, 250, 255, .97), rgba(241, 248, 255, .9) 38%, rgba(238, 246, 255, .52) 72%, rgba(239, 242, 255, .48));
}
html[data-theme="light"] .mgm-hero-eyebrow { color: #087fc4; }
html[data-theme="light"] .mgm-hero-content h1 { color: #173655; text-shadow: none; }
html[data-theme="light"] .mgm-hero-content h1 span { color: #1677e8; }
html[data-theme="light"] .mgm-hero-content p { color: #405b7a; }
html[data-theme="light"] .mgm-hero-tags span { color: #315477; background: rgba(255,255,255,.78); border-color: #d3e4f6; }
html[data-theme="light"] .mgm-hero-time { background: rgba(255,255,255,.84); border-color: #d5e4f5; }
html[data-theme="light"] .mgm-time-label,
html[data-theme="light"] .mgm-hero-time small { color: #637c99; }
html[data-theme="light"] .mgm-hero-time strong { color: #173655; }
html[data-theme="light"] .mgm-hero-bottom { color: rgba(48, 77, 112, .8); }

/* Tabel */
html[data-theme="light"] .table-wrap { border-color: #e0e8f2; }
html[data-theme="light"] table { color: #405571; }
html[data-theme="light"] thead { background: #f0f5fb; }
html[data-theme="light"] th { color: #637993; }
html[data-theme="light"] td { border-top-color: #e9eff6; }
html[data-theme="light"] tbody tr:hover { background: #f3f8ff; }
html[data-theme="light"] td b { color: #243b59; }
html[data-theme="light"] td small { color: #71849c; }
html[data-theme="light"] .empty { color: #71849c; }

/* Formulir dan kontrol input */
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    color: #203752;
    background-color: #ffffff;
    border-color: #d5e1ef;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #8b9bb0; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
    border-color: #72b4f7;
    box-shadow: 0 0 0 3px rgba(22, 119, 232, .1);
}
html[data-theme="light"] label { color: #405875; }
html[data-theme="light"] .form-group label,
html[data-theme="light"] .form-label { color: #405875; }
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-outline {
    color: #315477;
    border-color: #d5e2f1;
    background: #ffffff;
}
html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn-outline:hover { background: #f0f6ff; }

/* Peta Leaflet dan kontrol peta */
html[data-theme="light"] .map-box { border-color: #d8e5f3; background: #edf4fb; }
html[data-theme="light"] .map-box:empty::before { color: #71849b; }
html[data-theme="light"] .leaflet-container { background: #edf4fb; }
html[data-theme="light"] .panel:has(#admin-map) {
    border-color: #dce8f5;
    background: radial-gradient(circle at 0% 0%, rgba(0, 153, 255, .035), transparent 42%), #ffffff;
    box-shadow: var(--shadow);
}
html[data-theme="light"] .panel:has(#admin-map) .panel-head h2 { color: #203752; }
html[data-theme="light"] .panel:has(#admin-map) .panel-head p,
html[data-theme="light"] .panel:has(#admin-map) > .muted { color: #6e8198; }
html[data-theme="light"] #admin-map.map-box {
    border-color: #cddff2;
    background: #edf4fb;
    box-shadow: 0 0 0 4px rgba(25, 137, 255, .025), 0 10px 28px rgba(34, 66, 108, .08);
}
html[data-theme="light"] #admin-map .leaflet-control-zoom {
    border-color: #d2e1f1 !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 6px 18px rgba(34,66,108,.12) !important;
}
html[data-theme="light"] #admin-map .leaflet-control-zoom a {
    color: #24577f !important;
    background: #ffffff !important;
    border-color: #e3ebf4 !important;
}
html[data-theme="light"] #admin-map .leaflet-control-zoom a:hover { color: #ffffff !important; background: #1677e8 !important; }
html[data-theme="light"] #admin-map .leaflet-control-attribution { color: #526983 !important; background: rgba(255,255,255,.92) !important; }
html[data-theme="light"] #admin-map .leaflet-control-attribution a { color: #176fc4 !important; }
html[data-theme="light"] #admin-map .leaflet-popup-content-wrapper { color: #203752; background: #ffffff; border-color: #d6e5f5; }
html[data-theme="light"] #admin-map .leaflet-popup-tip { background: #ffffff; }
html[data-theme="light"] #admin-map .leaflet-popup-close-button { color: #176fc4 !important; }

/* Aktivitas, status, dan elemen umum */
html[data-theme="light"] .activity-row { border-bottom-color: #e7edf5; }
html[data-theme="light"] .activity-row b { color: #243b59; }
html[data-theme="light"] .activity-row p { color: #607690; }
html[data-theme="light"] .activity-row small { color: #8092a8; }
html[data-theme="light"] .mgm-notif-trigger,
html[data-theme="light"] .mgm-theme-toggle {
    color: #315477;
    border-color: #d7e3f1;
    background: #ffffff;
}
html[data-theme="light"] .mgm-notif-trigger:hover,
html[data-theme="light"] .mgm-theme-toggle:hover { color: #126fca; border-color: #9dc9f5; background: #f2f8ff; }
html[data-theme="light"] .mgm-notif-count { border-color: #ffffff; }
html[data-theme="light"] .mgm-notif-panel,
html[data-theme="light"] .mgm-profile-dropdown {
    color: #263e5c;
    background: rgba(255,255,255,.98);
    border-color: #dce6f2;
    box-shadow: 0 18px 42px rgba(35, 68, 110, .16);
}
html[data-theme="light"] .mgm-notif-head { border-bottom-color: #e5edf6; }
html[data-theme="light"] .mgm-notif-head strong,
html[data-theme="light"] .mgm-notif-item strong,
html[data-theme="light"] .mgm-profile-summary-text strong { color: #203752; }
html[data-theme="light"] .mgm-notif-head small,
html[data-theme="light"] .mgm-notif-item span,
html[data-theme="light"] .mgm-profile-summary-text small,
html[data-theme="light"] .mgm-notif-empty { color: #6f829a; }
html[data-theme="light"] .mgm-notif-sound { color: #315477; border-color: #d7e3f1; background: #f5f8fc; }
html[data-theme="light"] .mgm-notif-item { color: #315477; }
html[data-theme="light"] .mgm-notif-item:hover { background: #f0f6ff; border-color: #dce9f8; }
html[data-theme="light"] .mgm-profile-summary { border-bottom-color: #e5edf6; }
html[data-theme="light"] .mgm-profile-dropdown a { color: #405875; }
html[data-theme="light"] .mgm-profile-dropdown a:hover,
html[data-theme="light"] .mgm-profile-dropdown a:focus-visible { color: #126fca; background: #f0f6ff; }
html[data-theme="light"] .mgm-profile-dropdown .mgm-profile-logout { border-top-color: #e5edf6; color: #c43e56; }
html[data-theme="light"] .mgm-profile-dropdown .mgm-profile-logout:hover { color: #b52843; background: #fff0f2; }
html[data-theme="light"] .alert { color: #254565; }

/* Login belum memiliki tombol tema karena berada di luar kerangka page_header. */

@media (prefers-reduced-motion: reduce) {
    html[data-theme="light"] *,
    html[data-theme="light"] *::before,
    html[data-theme="light"] *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* =========================================================
   PERBAIKAN FINAL LIGHT MODE — DASHBOARD KARYAWAN
   Mengatasi style inline dashboard yang sebelumnya menimpa CSS.
   Dark Mode tidak terpengaruh.
========================================================= */
html[data-theme="light"] body .employee-dashboard {
    color: #203752 !important;
    --ed-muted: #657b96;
}

/* Banner tetap navy agar judul putih memiliki kontras yang benar. */
html[data-theme="light"] body .employee-dashboard .employee-welcome {
    background:
        radial-gradient(circle at 88% 12%, rgba(130, 92, 255, .24), transparent 38%),
        linear-gradient(110deg, #10284a 0%, #0a1b35 58%, #171a43 100%) !important;
    border: 1px solid rgba(69, 174, 255, .42) !important;
    box-shadow: 0 14px 34px rgba(35, 68, 110, .15) !important;
}
html[data-theme="light"] body .employee-dashboard .employee-welcome .employee-welcome-copy h1,
html[data-theme="light"] body .employee-dashboard .employee-welcome h1 {
    color: #f5f9ff !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .2) !important;
}
html[data-theme="light"] body .employee-dashboard .employee-welcome .employee-welcome-copy p,
html[data-theme="light"] body .employee-dashboard .employee-welcome p {
    color: #c7d9f2 !important;
}
html[data-theme="light"] body .employee-dashboard .employee-welcome .eyebrow {
    color: #42e6ff !important;
}

/* Kartu Jam Masuk dan Jam Pulang pada statistik utama. */
html[data-theme="light"] body .employee-dashboard .employee-stats .stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7faff 100%) !important;
    border: 1px solid #dbe7f5 !important;
    box-shadow: 0 8px 24px rgba(36, 75, 122, .07) !important;
}
html[data-theme="light"] body .employee-dashboard .employee-stats .stat-label {
    color: #526984 !important;
}
html[data-theme="light"] body .employee-dashboard .employee-stats .stat-card > strong,
html[data-theme="light"] body .employee-dashboard .employee-stats .stat-card strong.small-number {
    color: #183451 !important;
}
html[data-theme="light"] body .employee-dashboard .employee-stats .stat-card > small {
    color: #627993 !important;
}

/* Panel status absensi: hilangkan latar abu-abu gelap dan tingkatkan kontras. */
html[data-theme="light"] body .employee-dashboard .status-detail > div {
    background: linear-gradient(145deg, #ffffff 0%, #f5f9ff 100%) !important;
    background-color: #ffffff !important;
    color: #203752 !important;
    border: 1px solid #d9e6f5 !important;
    box-shadow: 0 5px 16px rgba(34, 66, 108, .055) !important;
}
html[data-theme="light"] body .employee-dashboard .status-detail > div small {
    color: #617791 !important;
}
html[data-theme="light"] body .employee-dashboard .status-detail > div b {
    color: #193754 !important;
}
html[data-theme="light"] body .employee-dashboard .status-detail .attendance-state-chip {
    color: #1765a5 !important;
    background: #edf6ff !important;
    border-color: #cfe4fa !important;
}
html[data-theme="light"] body .employee-dashboard .status-detail .attendance-state-chip.late {
    color: #95520a !important;
    background: #fff5e5 !important;
    border-color: #f4d9ad !important;
}
html[data-theme="light"] body .employee-dashboard .status-detail .attendance-state-chip.done {
    color: #087653 !important;
    background: #eafaf3 !important;
    border-color: #c7efdf !important;
}

/* Teks panel dan keterangan dashboard karyawan. */
html[data-theme="light"] body .employee-dashboard .panel-head h2 {
    color: #193653 !important;
}
html[data-theme="light"] body .employee-dashboard .panel-head p,
html[data-theme="light"] body .employee-dashboard .muted {
    color: #6b8099 !important;
}
html[data-theme="light"] body .employee-dashboard .action-card {
    box-shadow: 0 8px 22px rgba(34, 66, 108, .07) !important;
}

@media (max-width: 700px) {
    html[data-theme="light"] body .employee-dashboard .employee-welcome {
        background: linear-gradient(145deg, #10284a, #0a1b35 70%, #171a43) !important;
    }
    html[data-theme="light"] body .employee-dashboard .status-detail > div {
        min-width: 0;
    }
}

/* =========================================================
   MGM SIDEBAR — TOWER GLASS FINISH
   Tambahan override aman: aturan halaman lain tetap dipertahankan.
   Gambar: assets/images/mgm-tower.png
========================================================= */
.sidebar {
    position: fixed;
    isolation: isolate;
    overflow-x: hidden;
    background: #041126;
    border-right: 1px solid rgba(61, 178, 255, .28);
    box-shadow: 12px 0 38px rgba(0, 0, 0, .18);
}

/* Foto tower samar di belakang menu */
.sidebar::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image: url("images/mgm-tower.png");
    background-size: cover;
    background-position: center bottom;
    opacity: .42;
    filter: saturate(1.08) blur(.35px);
    transform: scale(1.015);
    pointer-events: none;
}

/* Lapisan navy menjaga teks tetap terbaca */
.sidebar::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 13, 31, .96) 0%, rgba(4, 18, 41, .82) 36%, rgba(4, 15, 34, .62) 72%, rgba(3, 12, 28, .96) 100%),
        linear-gradient(90deg, rgba(4, 14, 32, .32), rgba(4, 14, 32, .08));
    pointer-events: none;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar .brand {
    min-height: 54px;
    margin: 0 0 25px;
    padding: 3px 6px 18px;
    border-bottom: 1px solid rgba(103, 183, 255, .13);
}

.sidebar .brand-icon {
    border-radius: 12px;
    box-shadow: 0 0 18px rgba(0, 145, 255, .26), inset 0 1px 0 rgba(255,255,255,.3);
}

.sidebar .side-label {
    margin: 10px 8px 9px;
    padding: 8px 8px 7px;
    color: #7196c3;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.55px;
}

.sidebar .nav-link {
    position: relative;
    min-height: 43px;
    margin: 0 0 5px;
    padding: 6px 10px;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #a9c1e0;
    background: rgba(5, 20, 43, .25);
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.sidebar .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 2px;
    border-radius: 3px;
    background: linear-gradient(180deg, #26eaff, #5b69ff);
    box-shadow: 0 0 10px rgba(38, 234, 255, .7);
    opacity: 0;
    transition: opacity .2s ease;
}

.sidebar .nav-link:hover {
    color: #f4fbff;
    border-color: rgba(66, 178, 255, .22);
    background: rgba(16, 73, 126, .38);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: #58eaff;
    border-color: rgba(36, 177, 255, .5);
    background: linear-gradient(105deg, rgba(0, 174, 255, .2), rgba(70, 75, 232, .24));
    box-shadow: inset 0 0 18px rgba(24, 141, 255, .08), 0 5px 18px rgba(0, 10, 30, .12);
}

.sidebar .nav-link.active::before { opacity: 1; }

.sidebar .nav-link > .nav-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    border-color: rgba(113, 183, 255, .16);
    background: rgba(10, 34, 64, .72);
    color: #91b7e3;
}

.sidebar .nav-link:hover > .nav-icon {
    color: #64eaff;
    border-color: rgba(53, 206, 255, .42);
    background: rgba(12, 100, 151, .35);
}

.sidebar .nav-link.active > .nav-icon {
    color: #5ceaff;
    border-color: rgba(68, 213, 255, .5);
    background: linear-gradient(145deg, rgba(0, 197, 255, .22), rgba(94, 76, 255, .24));
    box-shadow: 0 0 14px rgba(0, 179, 255, .12), inset 0 1px 0 rgba(255,255,255,.07);
}

.sidebar .nav-link > .nav-text {
    font-size: 12px;
    font-weight: 650;
    letter-spacing: -.1px;
}

.sidebar .sidebar-foot {
    margin-top: auto;
    padding: 18px 8px 3px;
    border-top: 1px solid rgba(103, 183, 255, .16);
    color: #6d91ba;
    font-size: 9px;
    line-height: 1.8;
    letter-spacing: 1.1px;
}

.sidebar .sidebar-foot b {
    color: #b0cbed;
    font-weight: 800;
}

.sidebar .sidebar-foot small {
    color: #7592b4;
    font-size: 8px;
}

/* Pastikan konten tidak melebar di layar kecil */
.main-area { min-width: 0; }
.page-content { min-width: 0; }

@media (max-width: 900px) {
    .sidebar {
        width: 244px;
        max-width: 84vw;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: min(270px, 84vw);
        max-width: 84vw;
        padding: 16px 12px 13px;
        transform: translateX(-105%);
        transition: transform .26s cubic-bezier(.2,.75,.25,1);
        box-shadow: 22px 0 48px rgba(0, 0, 0, .42);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar .brand { margin-bottom: 17px; padding-bottom: 14px; }
    .sidebar .side-label { margin-top: 8px; }
    .sidebar .nav-link { min-height: 42px; margin-bottom: 4px; }
    .sidebar .sidebar-foot { padding-top: 13px; }
    .main-area { width: 100%; margin-left: 0 !important; }
    .page-content { padding: 15px 13px; }
    .topbar { padding: 9px 12px; }
}

@media (max-width: 380px) {
    .sidebar { width: 258px; max-width: 82vw; }
    .sidebar .brand b { font-size: 13px; }
    .sidebar .nav-link > .nav-text { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar .nav-link,
    .sidebar .nav-link::before,
    .sidebar { transition: none !important; }
}


/* =========================================================
   FIX SIDEBAR TOWER — BACKGROUND LEBIH HALUS & MENU TERBACA
   Override aman untuk menggantikan efek tower yang terlalu dominan.
========================================================= */
.sidebar {
    background-color: #040d1e !important;
    isolation: isolate;
}

.sidebar::before {
    opacity: .19 !important;
    filter: saturate(.82) blur(1.1px) brightness(.72) !important;
    background-position: center 58% !important;
    transform: scale(1.025);
}

.sidebar::after {
    background: linear-gradient(180deg,
        rgba(3, 12, 29, .97) 0%,
        rgba(4, 15, 35, .91) 32%,
        rgba(4, 15, 35, .88) 70%,
        rgba(3, 11, 26, .98) 100%
    ) !important;
}

.sidebar .brand,
.sidebar .side-label,
.sidebar .nav-link,
.sidebar .sidebar-foot {
    text-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}

.sidebar .nav-link {
    background-color: rgba(5, 18, 39, .52);
}

.sidebar .nav-link.active {
    background: linear-gradient(105deg,
        rgba(0, 174, 255, .24),
        rgba(70, 75, 232, .27)
    ) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
    .sidebar::before {
        opacity: .13 !important;
        filter: saturate(.75) blur(1.4px) brightness(.65) !important;
        background-position: center 55% !important;
    }
    .sidebar::after {
        background: linear-gradient(180deg,
            rgba(3, 12, 29, .98),
            rgba(4, 15, 35, .94) 55%,
            rgba(3, 11, 26, .99)
        ) !important;
    }
}


/* EabsensiMGM — shared responsive polish, safe additive overrides */
.page-content { min-width: 0; }
.main-area { min-width: 0; }
button, .btn, .nav-link, a { -webkit-tap-highlight-color: transparent; }
:where(input, select, textarea, button, a):focus-visible { outline-offset: 3px; }
@media (max-width: 760px) {
    .page-content { padding: 15px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .topbar { gap: 8px; min-height: 58px; }
    .topbar strong { font-size: 13px; }
    .topbar small { font-size: 9px; }
    .topbar-right { gap: 7px; }
}
@media (max-width: 380px) {
    .page-content { padding-left: 9px; padding-right: 9px; }
    .topbar { padding-left: 9px; padding-right: 9px; }
}

/* =========================================================
   EabsensiMGM — SIDEBAR TOWER BACKGROUND
   Simpan gambar sebagai: assets/images/sidebar-tower.png
   ========================================================= */
.sidebar {
    position: fixed;
    isolation: isolate;
    overflow-x: hidden;
    background-color: #041026;
    background-image:
        linear-gradient(
            180deg,
            rgba(4, 13, 30, .96) 0%,
            rgba(5, 19, 42, .88) 42%,
            rgba(4, 12, 27, .95) 100%
        ),
        url("images/sidebar-tower.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: cover;
}

/* Lapisan cahaya dan tekstur halus di atas gambar */
.sidebar::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 85% 78%, rgba(0, 164, 255, .17), transparent 45%),
        linear-gradient(90deg, rgba(3, 12, 27, .12), rgba(3, 12, 27, .20));
}

.sidebar::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(53, 231, 255, .5),
        rgba(53, 231, 255, .08) 48%,
        rgba(53, 231, 255, .28)
    );
    box-shadow: 0 0 12px rgba(53, 231, 255, .12);
}

/* Isi sidebar berada di atas lapisan gambar */
.sidebar > * {
    position: relative;
    z-index: 1;
}

/* Keterbacaan brand dan menu */
.sidebar .brand,
.sidebar .side-label,
.sidebar .nav-link,
.sidebar .sidebar-foot {
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

.sidebar .nav-link {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.sidebar .nav-link:hover {
    background: rgba(14, 91, 159, .34);
    border-color: rgba(53, 197, 255, .32);
}

.sidebar .nav-link.active {
    background: linear-gradient(110deg, rgba(0, 153, 255, .32), rgba(95, 65, 255, .28));
    border-color: rgba(49, 183, 255, .62);
    box-shadow: inset 0 0 22px rgba(28, 109, 255, .12), 0 4px 18px rgba(0, 0, 0, .12);
}

/* Tema terang: gambar tetap terlihat tetapi dibuat lebih lembut */
html[data-theme="light"] .sidebar {
    background-color: #edf5ff !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(245, 249, 255, .95) 0%,
            rgba(240, 247, 255, .87) 48%,
            rgba(231, 241, 255, .95) 100%
        ),
        url("images/sidebar-tower.png") !important;
    background-repeat: no-repeat !important;
    background-position: center bottom !important;
    background-size: cover !important;
}

html[data-theme="light"] .sidebar::before {
    background:
        radial-gradient(ellipse at 85% 78%, rgba(22, 140, 255, .12), transparent 48%),
        linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .20));
}

html[data-theme="light"] .sidebar .brand,
html[data-theme="light"] .sidebar .side-label,
html[data-theme="light"] .sidebar .nav-link,
html[data-theme="light"] .sidebar .sidebar-foot {
    text-shadow: none;
}

html[data-theme="light"] .sidebar .nav-link:hover {
    background: rgba(22, 140, 255, .10) !important;
    border-color: rgba(22, 140, 255, .24) !important;
}

html[data-theme="light"] .sidebar .nav-link.active {
    background: linear-gradient(110deg, rgba(0, 153, 255, .16), rgba(95, 65, 255, .10)) !important;
    border-color: rgba(22, 140, 255, .35) !important;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar .nav-link {
        transition: none;
    }
}


/* =========================================================
   FIX NAVIGASI SIDEBAR — Data Karyawan dan menu lainnya
   Tambahan aman: tidak mengubah tampilan atau URL menu.
========================================================= */
.sidebar {
    z-index: 1000;
    isolation: isolate;
}

.sidebar::before,
.sidebar::after {
    pointer-events: none !important;
}

.sidebar > .nav-link,
.sidebar a.nav-link {
    position: relative !important;
    z-index: 5 !important;
    display: flex;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.sidebar a.nav-link .nav-icon,
.sidebar a.nav-link .nav-text,
.sidebar a.nav-link > span {
    pointer-events: none;
}

.sidebar a.nav-link:focus-visible {
    outline: 2px solid #35e7ff;
    outline-offset: 2px;
}
