/* ============================================================
   HRIS DIRE PRATAMA - STYLE UTAMA
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #0b1b2e;
    --navy-light: #17385c;
    --teal: #0fa6a0;
    --teal-light: #e2f6f4;
    --amber: #f2a93b;
    --red: #dc4c4c;
    --red-light: #fbe6e6;
    --green: #2e9e6d;
    --green-light: #e4f5ec;
    --blue: #3b6fd9;
    --blue-light: #e8eefb;
    --purple: #7c4fd6;
    --purple-light: #f1e9fb;
    --coral: #e8664f;
    --coral-light: #fce6e1;
    --paper: #f6f4ee;
    --card: #ffffff;
    --line: #e6e2d6;
    --line-strong: #d8d3c3;
    --ink: #10141c;
    --ink-light: #667085;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(11,27,46,0.08);
    --sidebar-w: 240px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background:
        repeating-linear-gradient(135deg, rgba(11,27,46,0.02) 0px, rgba(11,27,46,0.02) 1px, transparent 1px, transparent 28px),
        linear-gradient(165deg, #fbfcfa 0%, #f5f6f2 45%, var(--paper) 100%);
    background-attachment: fixed;
}

/* Animated ambient blobs — soft, brand-colored, drifting slowly behind everything */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -2;
    pointer-events: none;
    opacity: 0.85;
}

body::before {
    width: 560px;
    height: 560px;
    top: -160px;
    left: -140px;
    background: radial-gradient(circle, rgba(15,166,160,0.38), transparent 72%);
    animation: blobFloatA 20s ease-in-out infinite;
}

body::after {
    width: 620px;
    height: 620px;
    bottom: -200px;
    right: -180px;
    background: radial-gradient(circle, rgba(242,169,59,0.30), transparent 72%);
    animation: blobFloatB 24s ease-in-out infinite;
}

.page-body::after {
    content: '';
    position: fixed;
    top: 30%;
    right: 8%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,111,217,0.16), transparent 70%);
    filter: blur(80px);
    z-index: -2;
    pointer-events: none;
    animation: blobFloatC 26s ease-in-out infinite;
}

@keyframes blobFloatA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(70px, 50px) scale(1.15); }
}

@keyframes blobFloatB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -40px) scale(1.1); }
}

@keyframes blobFloatC {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 60px) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after, .page-body::after { animation: none; }
}

/* ============================================================
   CUTE STICKERS & MASCOT 🎉
============================================================ */
.sticker {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

.sticker-float  { animation: stickerFloat 4s ease-in-out infinite; }
.sticker-float-slow { animation: stickerFloat 5.6s ease-in-out infinite 0.4s; }
.sticker-spin   { animation: stickerSpin 10s linear infinite; }
.sticker-wiggle { animation: stickerWiggle 2.6s ease-in-out infinite; }
.sticker-pop    { animation: stickerPop 0.6s cubic-bezier(.34,1.6,.64,1) both; }

@keyframes stickerFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(6deg); }
}

@keyframes stickerSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes stickerWiggle {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.08); }
}

@keyframes stickerPop {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.login-hero { position: relative; }

.mascot-wrap {
    position: absolute;
    z-index: 3;
    animation: mascotBounce 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

.mascot-wrap .mascot-eye { animation: mascotBlink 4.5s ease-in-out infinite; transform-origin: center; }

@keyframes mascotBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.mascot-wave {
    transform-origin: 70% 80%;
    animation: mascotWave 2.2s ease-in-out infinite;
}

@keyframes mascotWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-18deg); }
    50% { transform: rotate(6deg); }
    75% { transform: rotate(-10deg); }
}

/* subtle dot texture drifting very slowly across the app — refined, not playful */
.main-content::after {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(rgba(15,166,160,0.10) 1.5px, transparent 1.5px),
        radial-gradient(rgba(242,169,59,0.09) 1.5px, transparent 1.5px);
    background-size: 64px 64px, 96px 96px;
    background-position: 0 0, 40px 30px;
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
    animation: confettiDrift 60s linear infinite;
}

@media (max-width: 768px) {
    .main-content::after { left: 0; }
}

@keyframes confettiDrift {
    from { background-position: 0 0, 60px 90px, 130px 20px; }
    to { background-position: 140px 140px, -130px 280px, -90px 240px; }
}

h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ============================================================
   LOGIN
============================================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1.2;
    background: var(--navy);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-left {
    background:
        repeating-radial-gradient(circle at 85% 10%, rgba(15,166,160,0.09) 0px, rgba(15,166,160,0.09) 1px, transparent 1px, transparent 24px),
        radial-gradient(ellipse 70% 55% at 88% 18%, rgba(15,166,160,0.30), transparent 60%),
        radial-gradient(ellipse 90% 70% at 105% 100%, rgba(242,169,59,0.22), transparent 55%),
        radial-gradient(ellipse 60% 50% at -5% 85%, rgba(124,79,214,0.16), transparent 60%),
        linear-gradient(165deg, #0d2038 0%, var(--navy) 55%, #081422 100%);
}

/* Motif organisasi: node-node anak perusahaan yang terhubung ke induk.
   Bukan dekorasi acak — ini merepresentasikan struktur 4 anak perusahaan
   yang disebut di copy ("4 Anak Perusahaan"). Diposisikan di ruang kosong
   tengah-kanan, di atas strip tambang, supaya tidak tumpang tindih. */
.org-graphic {
    position: absolute;
    right: 0;
    top: 44%;
    width: 38%;
    max-width: 300px;
    opacity: 0.85;
    pointer-events: none;
}

.login-mine-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 130px;
    pointer-events: none;
}

.org-graphic .og-line {
    stroke: rgba(255,255,255,0.22);
    stroke-width: 1.4;
    fill: none;
}

.org-graphic .og-node-ring {
    stroke: rgba(15,166,160,0.7);
    stroke-width: 1.2;
    fill: none;
}

.org-graphic .og-node {
    fill: var(--navy);
    stroke: rgba(255,255,255,0.25);
    stroke-width: 1;
}

.org-graphic .og-node-main {
    fill: var(--teal);
    stroke: none;
}

.org-graphic .og-pulse {
    fill: var(--teal);
    opacity: 0;
    animation: ogPulse 3.2s ease-out 0.6s 1;
}

.org-graphic .og-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8.5px;
    fill: rgba(255,255,255,0.55);
    letter-spacing: 0.04em;
}

@keyframes ogPulse {
    0% { opacity: 0.55; r: 4; }
    70% { opacity: 0; r: 22; }
    100% { opacity: 0; r: 22; }
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--teal);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.login-brand .brand-logo-full {
    max-width: 140px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    animation: loginLogoGlow 4.5s ease-in-out infinite;
}

@keyframes loginLogoGlow {
    0%, 100% { filter: drop-shadow(0 4px 14px rgba(0,0,0,0.3)); }
    50% { filter: drop-shadow(0 4px 26px rgba(15,166,160,0.55)); }
}

.login-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 26px 26px;
    animation: dotsDrift 50s linear infinite;
    pointer-events: none;
}

@keyframes dotsDrift {
    from { background-position: 0 0; }
    to { background-position: 300px 300px; }
}

.login-brand .brand-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}

.login-brand h2 { font-size: 18px; }
.login-brand p { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.06em; }

.login-hero {
    position: relative;
    z-index: 1;
    max-width: 400px;
}

.login-hero .tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-hero h1 {
    font-size: 42px;
    font-weight: 600;
    margin: 14px 0 16px;
    line-height: 1.12;
    letter-spacing: -0.015em;
}

.login-hero p {
    color: rgba(255,255,255,0.58);
    font-size: 14.5px;
    line-height: 1.7;
    max-width: 340px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 26px;
    position: relative;
    z-index: 1;
}

.hero-stat strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    color: #fff;
}

.hero-stat span {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.login-companies {
    display: flex;
    gap: 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    position: relative;
    z-index: 1;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.login-right {
    flex: 1;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 620px;
    height: 620px;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle, rgba(15,166,160,0.16), transparent 62%),
        radial-gradient(circle at 70% 65%, rgba(242,169,59,0.14), transparent 55%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
}

.login-card {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    padding: 38px 32px 32px;
    border-radius: calc(var(--radius) + 6px);
    box-shadow: 0 24px 56px rgba(11,27,46,0.16), 0 2px 0 rgba(15,166,160,0.12);
    border: 1px solid rgba(255,255,255,0.6);
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.4s ease both;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: calc(var(--radius) + 6px) calc(var(--radius) + 6px) 0 0;
    background: linear-gradient(90deg, var(--teal), var(--amber));
}

.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card > p { color: var(--ink-light); font-size: 13px; margin-bottom: 22px; }

.login-card .form-group input {
    border-color: rgba(15,166,160,0.22);
    background: linear-gradient(180deg, #fcfcfa, var(--paper));
}

.login-card .btn-primary {
    background: linear-gradient(120deg, #12b8ae, var(--teal) 55%, #0c8f89);
    box-shadow: 0 6px 18px rgba(15,166,160,0.32);
}

.role-select-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 4px;
}

.role-pill {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--ink-light);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 6px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.role-pill:hover { color: var(--ink); }

.role-pill.active {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 4px 10px rgba(11,27,46,0.25);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-light);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group label .required { color: var(--red); margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    background: var(--paper);
    color: var(--ink);
    outline: none;
    transition: border 0.2s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15,166,160,0.1);
}

.form-group input:disabled,
.form-group input[readonly] {
    background: #f0f0f0;
    color: var(--ink-light);
    cursor: not-allowed;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15,166,160,0.25);
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,166,160,0.32); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.full { width: 100%; }

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-secondary:hover { background: var(--paper); }

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.error-text {
    color: var(--red);
    font-size: 12px;
    margin-top: 10px;
    min-height: 18px;
}

.success-text {
    color: var(--green);
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
    min-height: 18px;
}
.success-text:not(:empty) {
    background: var(--green-light);
    padding: 8px 12px;
    border-radius: 8px;
}

/* ============================================================
   APP SHELL
============================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background:
        repeating-radial-gradient(circle at 82% 12%, rgba(15,166,160,0.06) 0px, rgba(15,166,160,0.06) 1px, transparent 1px, transparent 22px),
        repeating-radial-gradient(circle at 15% 88%, rgba(242,169,59,0.05) 0px, rgba(242,169,59,0.05) 1px, transparent 1px, transparent 30px),
        linear-gradient(190deg, #0d2038 0%, var(--navy) 55%, #081422 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}

.sidebar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--teal), var(--amber));
}

.sidebar::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,166,160,0.12), transparent 70%);
    pointer-events: none;
}

.sidebar-scene {
    padding: 4px 16px 10px;
    position: relative;
    z-index: 1;
}
.sidebar-scene svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: rgba(0,0,0,0.15);
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 24px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 1;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-brand-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    letter-spacing: -0.01em;
}
.sidebar-brand-text span {
    display: block;
    background: linear-gradient(90deg, var(--teal), #35c4bd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25)); }
    50% { filter: drop-shadow(0 2px 18px rgba(15,166,160,0.6)); }
}

.sidebar-logo .brand-subtitle {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-menu {
    padding: 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.sidebar-menu-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 0 12px 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.62);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    text-align: left;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
    transform: translateX(2px);
}

.menu-item.active {
    background: rgba(15,166,160,0.16);
    color: #fff;
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--teal);
}

.menu-item.active .menu-icon {
    background: var(--teal);
    color: #fff;
}

/* Aksen warna per-menu supaya sidebar tidak monoton satu warna */
.menu-item.accent-blue.active { background: rgba(59,111,217,0.18); }
.menu-item.accent-blue.active::before { background: var(--blue); }
.menu-item.accent-blue.active .menu-icon { background: var(--blue); box-shadow: 0 3px 10px rgba(59,111,217,0.35); }
.menu-item.accent-blue:hover .menu-icon { color: #8fb2f2; }

.menu-item.accent-purple.active { background: rgba(124,79,214,0.18); }
.menu-item.accent-purple.active::before { background: var(--purple); }
.menu-item.accent-purple.active .menu-icon { background: var(--purple); box-shadow: 0 3px 10px rgba(124,79,214,0.35); }
.menu-item.accent-purple:hover .menu-icon { color: #c7abf3; }

.menu-item.accent-amber.active { background: rgba(242,169,59,0.18); }
.menu-item.accent-amber.active::before { background: var(--amber); }
.menu-item.accent-amber.active .menu-icon { background: var(--amber); color: var(--navy); box-shadow: 0 3px 10px rgba(242,169,59,0.35); }
.menu-item.accent-amber:hover .menu-icon { color: #f8d190; }

.menu-item.accent-teal.active .menu-icon { box-shadow: 0 3px 10px rgba(15,166,160,0.35); }

.menu-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-size: 14px;
    border-radius: 7px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.menu-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    display: block;
}

.sidebar-bottom {
    padding: 16px 18px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 1;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    padding: 6px;
    margin: 0 -6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.user-box:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), #e0891f);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--navy);
    position: relative;
    box-shadow: 0 3px 10px rgba(242,169,59,0.35);
    animation: avatarPulse 3.5s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(242,169,59,0.35); }
    50% { box-shadow: 0 3px 10px rgba(242,169,59,0.35), 0 0 0 6px rgba(242,169,59,0.12); }
}

.avatar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--navy);
}

.user-box strong { display: block; font-size: 13px; }
.user-box small { font-size: 11px; color: rgba(255,255,255,0.5); }

.logout-btn {
    margin-top: 12px;
    width: 100%;
    padding: 9px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.profile-btn {
    width: 100%;
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 7px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    font-size: 11px;
}

.profile-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.logout-btn:hover {
    background: rgba(220,76,76,0.15);
    color: #fff;
    border-color: rgba(220,76,76,0.3);
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
}

.topbar {
    height: 68px;
    background: linear-gradient(180deg, #ffffff, #fbfbf8);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
    position: relative;
}

/* Sembunyikan topbar hanya selagi modal Tambah/Edit Karyawan terbuka,
   supaya bagian atas modal tidak ketutup. Halaman & modal lain tidak terpengaruh. */
body.modal-open-hide-topbar .topbar {
    display: none;
}

.topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--blue) 45%, var(--amber) 85%, transparent);
    opacity: 0.7;
}

.page-title { position: relative; padding-left: 14px; }
.page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--teal), var(--amber));
}
.page-title h1 { font-size: 19px; font-weight: 600; }
.page-title { min-width: 0; }
.page-title h1, .page-title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.sidebar-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 7px;
}
.sidebar-toggle-btn span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--navy);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11,27,46,0.45);
    z-index: 39;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.sidebar-overlay.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.page-title p { font-size: 12.5px; color: var(--ink-light); margin-top: 3px; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    font-size: 11.5px;
    color: var(--ink-light);
    font-family: 'IBM Plex Mono', monospace;
    text-align: right;
    line-height: 1.4;
    padding-right: 16px;
    border-right: 1px solid var(--line);
}
.topbar-date strong { display: block; color: var(--ink); font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600; }

.role-badge {
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--teal-light), #d9f2ef);
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid rgba(15,166,160,0.15);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15,166,160,0.28); }
    50% { box-shadow: 0 0 0 6px rgba(15,166,160,0); }
}

.page-body {
    padding: 24px 28px 50px;
    position: relative;
    z-index: 1;
}

.page-body::before {
    content: '';
    position: fixed;
    top: 68px;
    left: var(--sidebar-w);
    right: 0;
    height: 160px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxMjAwIDIyMCcgcHJlc2VydmVBc3BlY3RSYXRpbz0nbm9uZSc+CjxwYXRoIGQ9J00wLDE1MCBMMTEwLDE1MCBMMTEwLDExMiBMMjYwLDExMiBMMjYwLDE1OCBMNDAwLDE1OCBMNDAwLDkyIEw1NjAsOTIgTDU2MCwxMzggTDcwMCwxMzggTDcwMCw3NCBMODYwLDc0IEw4NjAsMTI2IEwxMDIwLDEyNiBMMTAyMCw2NCBMMTIwMCw2NCBMMTIwMCwyMjAgTDAsMjIwIFonIGZpbGw9JyMwZmE2YTAnIGZpbGwtb3BhY2l0eT0nMC40MicvPgo8cGF0aCBkPSdNMCwxNzggTDE1MCwxNzggTDE1MCwxNDYgTDMyMCwxNDYgTDMyMCwxODIgTDQ3MCwxODIgTDQ3MCwxMjAgTDYzMCwxMjAgTDYzMCwxNjAgTDc5MCwxNjAgTDc5MCwxMDQgTDk1MCwxMDQgTDk1MCwxNTAgTDExMDAsMTUwIEwxMTAwLDk2IEwxMjAwLDk2IEwxMjAwLDIyMCBMMCwyMjAgWicgZmlsbD0nI2YyYTkzYicgZmlsbC1vcGFjaXR5PScwLjM4Jy8+Cjwvc3ZnPg==");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
}

/* ============================================================
   CARDS
============================================================ */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.35s ease both;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--blue) 50%, var(--amber));
    opacity: 0.85;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fafaf8, #ffffff);
}

.card-header h3 { font-size: 14px; }
.card-header p { font-size: 11.5px; color: var(--ink-light); margin-top: 3px; }

/* ============================================================
   DASHBOARD HERO — open-pit mine scene, dusk over the pit
============================================================ */
.hero-scene {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 220px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.4s ease both;
}

.hero-scene svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-scene-copy {
    position: absolute;
    left: 26px;
    bottom: 20px;
    z-index: 1;
    color: #fff;
}

.hero-scene-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd98a;
    background: rgba(11,27,46,0.4);
    border: 1px solid rgba(255,217,138,0.35);
    border-radius: 999px;
    padding: 3px 11px;
    margin-bottom: 8px;
}

.hero-scene-copy h2 {
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
    margin-bottom: 10px;
}

.hero-scene-subs {
    display: flex;
    gap: 8px;
}

.hero-scene-subs span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    padding: 4px 9px;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
}

@media (max-width: 768px) {
    .hero-scene { height: 180px; }
    .hero-scene-copy h2 { font-size: 17px; }
    .hero-scene-subs { flex-wrap: wrap; max-width: 220px; }
}

/* ============================================================
   STATS
============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px 16px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeInUp 0.45s ease both;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--line-strong);
}
.stat-card:has(.stat-icon.blue)::before { background: linear-gradient(180deg, var(--blue), #6f93e8); }
.stat-card:has(.stat-icon.green)::before { background: linear-gradient(180deg, var(--green), #5cc394); }
.stat-card:has(.stat-icon.orange)::before { background: linear-gradient(180deg, var(--amber), #f7c876); }
.stat-card:has(.stat-icon.purple)::before { background: linear-gradient(180deg, #7c4fd6, #a683e6); }

.stat-card:has(.stat-icon.blue) { background: linear-gradient(115deg, var(--blue-light) -40%, #fff 32%); }
.stat-card:has(.stat-icon.green) { background: linear-gradient(115deg, var(--green-light) -40%, #fff 32%); }
.stat-card:has(.stat-icon.orange) { background: linear-gradient(115deg, #fdf1dd -40%, #fff 32%); }
.stat-card:has(.stat-icon.purple) { background: linear-gradient(115deg, var(--purple-light) -40%, #fff 32%); }

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.stat-card:hover .stat-icon { transform: scale(1.08); }
.stat-icon.blue { background: linear-gradient(145deg, var(--blue-light), #dbe7fb); color: var(--blue); }
.stat-icon.green { background: linear-gradient(145deg, var(--green-light), #d7f0e3); color: var(--green); }
.stat-icon.orange { background: linear-gradient(145deg, #fdf1dd, #fbe6c4); color: var(--amber); }
.stat-icon.purple { background: linear-gradient(145deg, #f1e9fb, #e6d9f9); color: #7c4fd6; }

.stat-label { font-size: 12px; color: var(--ink-light); }
.stat-value { font-size: 25px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; line-height: 1.2; }

.stat-body { display: flex; flex-direction: column; gap: 3px; }

.stat-trend {
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend.flat { color: var(--ink-light); }

/* ============================================================
   TABLE
============================================================ */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-light);
    background: linear-gradient(180deg, #e4f3f1, var(--paper));
    border-bottom: 2px solid var(--teal);
    white-space: nowrap;
}

td {
    padding: 11px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    white-space: nowrap;
}

tbody tr:nth-child(even) { background: rgba(15,166,160,0.025); }
tbody tr:hover { background: var(--teal-light); }
tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(11,27,46,0.06);
}

.badge-green { background: linear-gradient(135deg, var(--green-light), #d3f0e0); color: var(--green); }
.badge-red { background: linear-gradient(135deg, var(--red-light), #f9d9d9); color: var(--red); }
.badge-amber { background: linear-gradient(135deg, #fdf1dd, #fbe0b4); color: var(--amber); }
.badge-blue { background: linear-gradient(135deg, var(--blue-light), #d6e3fa); color: var(--blue); }
.badge-grey { background: linear-gradient(135deg, var(--paper), #ece8dd); color: var(--ink-light); }

/* ============================================================
   QUICK ACTIONS
============================================================ */
.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s, transform 0.15s;
    animation: fadeInUp 0.4s ease both;
}

.quick-action:nth-child(1) { animation-delay: 0.05s; }
.quick-action:nth-child(2) { animation-delay: 0.1s; }
.quick-action:nth-child(3) { animation-delay: 0.15s; }
.quick-action:nth-child(4) { animation-delay: 0.2s; }
.quick-action:nth-child(5) { animation-delay: 0.25s; }

.quick-action:last-child { border-bottom: none; }
.quick-action:hover { background: var(--paper); transform: translateX(3px); }
.quick-action:hover .quick-icon { transform: scale(1.08); }

.quick-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--teal-light);
    color: var(--teal);
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.quick-action strong { display: block; font-size: 13px; }
.quick-action span { font-size: 11.5px; color: var(--ink-light); }

.quick-icon svg { width: 17px; height: 17px; stroke: currentColor; }

/* ============================================================
   DOKUMEN UPLOAD CARDS
============================================================ */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.doc-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    animation: fadeInUp 0.4s ease both;
    overflow: hidden;
}

.doc-card:nth-child(1) { animation-delay: 0.02s; }
.doc-card:nth-child(2) { animation-delay: 0.06s; }
.doc-card:nth-child(3) { animation-delay: 0.1s; }
.doc-card:nth-child(4) { animation-delay: 0.14s; }
.doc-card:nth-child(5) { animation-delay: 0.18s; }

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.doc-card.has-file { border-color: var(--green); background: linear-gradient(180deg, #fff, var(--green-light) 260%); }

.doc-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
    background: linear-gradient(145deg, var(--teal-light), #d6f3f0);
    color: var(--teal);
    transition: transform 0.22s ease;
}

.doc-card:hover .doc-icon { transform: scale(1.08) rotate(-2deg); }

.doc-body { flex: 1; min-width: 0; }

.doc-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

.doc-formats { font-size: 10.5px; color: var(--ink-light); margin-top: 1px; }

.doc-filename {
    font-size: 11.5px;
    color: var(--teal);
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    word-break: break-all;
}

.doc-empty { font-size: 11.5px; color: var(--ink-light); margin-top: 6px; font-style: italic; }

.doc-actions { display: flex; gap: 6px; margin-top: 9px; }

.doc-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.doc-btn:hover { background: #fff; border-color: var(--line-strong); }
.doc-btn.danger { color: var(--red); }
.doc-btn.danger:hover { background: var(--red-light); border-color: var(--red-light); }

.doc-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.doc-card.has-file .doc-check { display: flex; }

/* ============================================================
   CUSTOM CONFIRM DIALOG (pengganti window.confirm bawaan browser)
============================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,27,46,0.55);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.confirm-overlay.open { opacity: 1; }

.confirm-card {
    background: #fff;
    border-radius: var(--radius);
    width: min(380px, 100%);
    padding: 26px 24px 22px;
    box-shadow: 0 20px 50px rgba(11,27,46,0.25);
    text-align: center;
    transform: scale(0.92) translateY(8px);
    transition: transform 0.2s cubic-bezier(.2,.8,.3,1.2);
}

.confirm-overlay.open .confirm-card { transform: scale(1) translateY(0); }

.confirm-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 800;
    background: var(--blue-light);
    color: var(--blue);
}

.confirm-icon.danger { background: var(--red-light); color: var(--red); }

.confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-message { font-size: 13px; color: var(--ink-light); line-height: 1.55; margin-bottom: 20px; }
.confirm-message strong { color: var(--ink); }

.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn-primary,
.confirm-actions .btn-secondary,
.confirm-actions .btn-danger { flex: 1; justify-content: center; }

.btn-danger {
    background: var(--red);
    color: #fff;
    border: 1px solid var(--red);
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    display: inline-flex;
    align-items: center;
}

.btn-danger:hover { background: #c53e3e; transform: translateY(-1px); }

/* ============================================================
   TOAST NOTIFICATIONS
============================================================ */
.toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink-light);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    max-width: 340px;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(.2,.8,.3,1.2), opacity 0.25s ease;
}

.toast.show { transform: translateX(0); opacity: 1; }

.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-info { border-left-color: var(--blue); }

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.toast-success .toast-icon { background: var(--green); }
.toast-error .toast-icon { background: var(--red); }
.toast-info .toast-icon { background: var(--blue); }

.toast-msg { line-height: 1.4; }

@media (max-width: 600px) {
    .toast-container { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
    .toast { max-width: none; }
}

/* ============================================================
   MINI STATS STRIP (Personal Data & Contract Logs)
============================================================ */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    animation: fadeInUp 0.4s ease both;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.mini-stat:nth-child(1) { animation-delay: 0s; }
.mini-stat:nth-child(2) { animation-delay: 0.06s; }
.mini-stat:nth-child(3) { animation-delay: 0.12s; }
.mini-stat:nth-child(4) { animation-delay: 0.18s; }

.mini-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }

.mini-stat-value { font-size: 18px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; line-height: 1.2; }
.mini-stat-label { font-size: 11px; color: var(--ink-light); margin-top: 1px; }
.quick-action b { margin-left: auto; color: var(--ink-light); font-size: 18px; }

/* ============================================================
   TOOLBAR
============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-width: 200px;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
    width: 100%;
}

.toolbar select,
.filter-group select {
    appearance: none;
    -webkit-appearance: none;
    padding: 9px 34px 9px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 16px;
    color: var(--ink);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border 0.2s;
}

.toolbar select:focus,
.filter-group select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15,166,160,0.1);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   FORM GRID
============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.form-section:last-child { border-bottom: none; }

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.form-section-desc {
    font-size: 12px;
    color: var(--ink-light);
    margin-bottom: 16px;
}

/* ============================================================
   EMPTY STATE
============================================================ */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-light);
}

.empty-state strong { display: block; font-size: 14px; color: var(--ink); }
.empty-state p { font-size: 12.5px; margin-top: 4px; }

/* ============================================================
   FORM TABS (modal Tambah/Edit Karyawan)
============================================================ */
.form-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    overflow-x: auto;
    background: #fff;
    position: sticky;
    top: 61px;
    z-index: 1;
}

.form-tab-btn {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-light);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.form-tab-btn:hover { color: var(--ink); }

.form-tab-btn.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

.form-tab-panel { display: none; }
.form-tab-panel.active { display: block; }

.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-navigation button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================================
   MODAL
============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: min(800px, 98%);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.modal-header h2 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ink-light);
    cursor: pointer;
    padding: 0 4px;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    background: #fff;
}

.modal-sm { width: min(480px, 96%); }

.modal-header-text h2 { font-size: 17px; margin-bottom: 3px; }
.modal-header-text p { font-size: 12px; color: var(--ink-light); }

.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-light);
    margin-bottom: 10px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 22px;
}

.modal-info-grid .full { grid-column: 1 / -1; }

.modal-info-item label {
    display: block;
    font-size: 10.5px;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}

.modal-info-item span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.contract-timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: flex;
    gap: 12px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
    margin-top: 5px;
    flex-shrink: 0;
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: var(--line);
    margin-top: 2px;
}

.timeline-content { padding-bottom: 18px; flex: 1; }

.timeline-content .tl-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2px;
}

.timeline-content .tl-sub {
    font-size: 12px;
    color: var(--ink-light);
}

/* ============================================================
   CONFIRM DIALOG, TOAST, IMPORT SUMMARY
   (menggantikan confirm()/alert() bawaan browser)
============================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,27,46,0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.16s ease;
}
.confirm-overlay.open { opacity: 1; }

.confirm-card {
    background: #fff;
    border-radius: 16px;
    width: min(380px, 100%);
    padding: 28px 26px 22px;
    text-align: center;
    box-shadow: 0 24px 48px rgba(11,27,46,0.24);
    transform: translateY(10px) scale(0.97);
    transition: transform 0.18s ease;
}
.confirm-overlay.open .confirm-card { transform: translateY(0) scale(1); }
.confirm-wide { width: min(480px, 100%); text-align: left; }
.confirm-wide h3, .confirm-wide > p { text-align: center; }

.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    font-size: 22px;
    background: var(--red-light);
    color: var(--red);
}
.confirm-icon-ok { background: var(--green-light); color: var(--green); }
.confirm-default .confirm-icon { background: var(--teal-light); color: var(--teal); }

.confirm-card h3 { font-size: 17px; margin-bottom: 6px; }
.confirm-card > p { font-size: 13px; color: var(--ink-light); line-height: 1.55; margin-bottom: 20px; }

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.confirm-actions .btn-sm { flex: 1; justify-content: center; }

.confirm-ok-danger {
    background: var(--red);
    color: #fff;
    border: 1px solid var(--red);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.confirm-ok-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

.import-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 4px 0 16px;
}
.import-stat {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}
.import-stat strong { display: block; font-size: 18px; font-family: 'Space Grotesk', sans-serif; }
.import-stat span { font-size: 10.5px; color: var(--ink-light); }
.import-stat.stat-ok strong { color: var(--green); }
.import-stat.stat-warn strong { color: var(--amber); }
.import-stat.stat-bad strong { color: var(--red); }

.import-hint {
    background: #fdf1dd;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12.5px;
    color: #8a6416;
    margin-bottom: 14px;
    line-height: 1.55;
}
.import-hint strong { display: block; margin-bottom: 4px; color: #6b4c0d; }
.import-hint code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
}

.import-errors {
    max-height: 140px;
    overflow-y: auto;
    background: var(--paper);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    margin-bottom: 16px;
}
.import-errors strong { display: block; margin-bottom: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-light); }
.import-errors ul { padding-left: 18px; color: var(--ink-light); }
.import-errors li { margin-bottom: 3px; }

.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 12px 28px rgba(11,27,46,0.16);
    font-size: 13px;
    font-weight: 500;
    min-width: 220px;
    max-width: 320px;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-left: 3px solid var(--teal);
}
.toast.open { transform: translateX(0); opacity: 1; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    flex-shrink: 0;
    color: #fff;
    background: var(--teal);
}
.toast-success .toast-icon { background: var(--green); }
.toast-error .toast-icon { background: var(--red); }

.modal-empty {
    font-size: 13px;
    color: var(--ink-light);
    padding: 12px 0;
}

/* ============================================================
   DASHBOARD: INSIGHTS (bar chart, donut, expiring list)
============================================================ */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-body { padding: 16px 18px 18px; }

.flowchart-card { overflow: hidden; }
.flow-legend { display: flex; align-items: center; gap: 14px; padding: 0 18px 12px; font-size: 11px; color: var(--ink-light); }
.flow-legend span { display: inline-flex; align-items: center; gap: 5px; }
.flow-legend a { margin-left: auto; color: var(--blue); font-weight: 600; }
.flow-key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.flow-key.in, .flow-bar.in { background: var(--teal); }
.flow-key.out, .flow-bar.out { background: var(--coral); }
.flow-branch-row { display: grid; grid-template-columns: 100px 1fr; align-items: end; gap: 12px; margin-bottom: 16px; }
.flow-branch-row:last-child { margin-bottom: 0; }
.flow-branch-row > strong { font-size: 12px; }
.flow-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; border-bottom: 1px solid var(--line); }
.flow-month { text-align: center; min-width: 0; }
.flow-bars { height: 110px; display: flex; justify-content: center; align-items: end; gap: 5px; }
.flow-bar { width: 14px; min-height: 3px; border-radius: 3px 3px 0 0; display: block; }
.flow-month small { display: block; padding-top: 8px; color: var(--ink-light); font-size: 11px; }

@media (max-width: 600px) {
    .flow-branch-row { grid-template-columns: 1fr; gap: 4px; }
    .flow-months { gap: 3px; }
}

/* Grafik Pergerakan — halaman Flowchart Karyawan */
.mv-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px 4px;
    font-size: 12px;
    color: var(--ink-light);
}
.mv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mv-key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mv-key.in, .mv-bar.in { background: var(--teal); }
.mv-key.out, .mv-bar.out { background: var(--coral); }

.mv-chart {
    padding: 8px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mv-row {
    display: flex;
    align-items: stretch;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.mv-row:last-child { border-bottom: none; }

.mv-row-label {
    flex: 0 0 90px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: flex-end;
    padding-bottom: 22px;
}

.mv-row-plot {
    flex: 1 1 auto;
    display: flex;
    gap: 28px;
    max-width: 560px;
}

.mv-month {
    flex: 0 0 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mv-bars {
    height: 64px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    border-bottom: 1px solid var(--line-strong);
}

.mv-bar {
    width: 11px;
    border-radius: 3px 3px 0 0;
    display: block;
    transition: height 0.5s ease;
}

.mv-month small {
    display: block;
    padding-top: 6px;
    color: var(--ink-light);
    font-size: 11px;
    font-weight: 500;
}

@media (max-width: 720px) {
    .mv-row { flex-direction: column; gap: 8px; }
    .mv-row-label { padding-bottom: 0; }
    .mv-row-plot { gap: 14px; max-width: 100%; overflow-x: auto; }
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.bar-row:last-child { margin-bottom: 0; }

.bar-label {
    width: 64px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
}

.bar-track {
    flex: 1;
    height: 10px;
    background: var(--paper);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal), #35c4bd);
    transition: width 0.9s cubic-bezier(.22,.9,.3,1);
    position: relative;
    overflow: hidden;
}

.bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
    width: 40%;
    animation: barShimmer 2.6s ease-in-out infinite;
}

@keyframes barShimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(280%); }
}

.bar-count {
    width: 26px;
    text-align: right;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 22px;
}

.donut {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    position: relative;
    animation: donutPop 0.7s cubic-bezier(.3,1.4,.5,1) both;
}

@keyframes donutPop {
    0% { transform: scale(0.6) rotate(-90deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.donut::after {
    content: '';
    position: absolute;
    inset: 16px;
    background: #fff;
    border-radius: 50%;
}

.donut-center {
    position: relative;
    z-index: 1;
    text-align: center;
}
.donut-center strong { display: block; font-size: 19px; font-family: 'Space Grotesk', sans-serif; }
.donut-center span { font-size: 9.5px; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.04em; }

.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }

.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend-label { flex: 1; color: var(--ink); }
.legend-value { font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--ink); }

.expiring-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    animation: fadeInUp 0.4s ease both;
}
.expiring-item:nth-child(1) { animation-delay: 0.05s; }
.expiring-item:nth-child(2) { animation-delay: 0.1s; }
.expiring-item:nth-child(3) { animation-delay: 0.15s; }
.expiring-item:nth-child(4) { animation-delay: 0.2s; }
.expiring-item:nth-child(5) { animation-delay: 0.25s; }
.expiring-item:last-child { border-bottom: none; }

.expiring-item strong { display: block; font-size: 13px; }
.expiring-item small { font-size: 11px; color: var(--ink-light); }

.expiring-badge {
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.expiring-badge.urgent { background: var(--red-light); color: var(--red); }
.expiring-badge.soon { background: #fdf1dd; color: var(--amber); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .login-wrapper { flex-direction: column; min-height: auto; }

    .login-left {
        flex: none;
        min-height: 132px;
        padding: 22px 24px;
        overflow: visible;
    }
    .login-hero, .login-companies, .org-graphic, .login-mine-strip { display: none; }
    .login-brand .brand-logo-full { max-width: 100px; }
    .sidebar-brand-text { font-size: 18px; }
    .sidebar-logo { padding: 18px 44px 14px 16px; }
    .login-left::after { opacity: 0.5; }

    .login-right { flex: 1; padding: 28px 18px 40px; }
    .login-right::before { width: 420px; height: 420px; }

    .sidebar {
        transform: translateX(-100%);
        width: min(280px, 82vw);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: flex; }
    .sidebar-toggle-btn { display: flex; }

    .main-content {
        margin-left: 0;
    }
    .page-body::before { left: 0; }

    .stat-grid { grid-template-columns: 1fr; }

    .topbar { padding: 0 14px; gap: 8px; }
    .topbar-right { gap: 10px; }
    .page-title p { display: none; }
    .page-body { padding: 16px; }

    .modal { width: 98%; }
    .modal-body { padding: 16px; }
}

@media (max-width: 480px) {
    .login-card { padding: 24px 20px; }
    .hero-stats { flex-wrap: wrap; gap: 18px; }
    .topbar-date { display: none; }
    .login-brand .brand-logo-full { max-width: 84px; }
    .login-left { min-height: 100px; padding: 16px 20px; }
    .sidebar-brand-text { font-size: 16px; }
}