/* ============================================================
   BCP KEUANGAN — Halaman Manajemen Keuangan
   Desain modern, rapi, friendly. Mengikuti design system theme
   (palet hijau/teal, Inter + Plus Jakarta Sans, radius & shadow).
   ============================================================ */

.keu-body {
    background: #F4F7F6;
    font-family: var(--font-body, 'Inter', sans-serif);
    color: var(--text-primary, #0F172A);
    min-height: 100vh;
}

.keu-body ::selection {
    background: var(--green-200, #A7F3D0);
}

/* ============================================================
   1. LOGIN — KEAMANAN LAYER 2
   ============================================================ */

.keu-login {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1200px 800px at 85% -10%, rgba(20, 184, 166, 0.25), transparent 60%),
        radial-gradient(900px 700px at -10% 110%, rgba(16, 185, 129, 0.22), transparent 55%),
        linear-gradient(160deg, #04150F 0%, #062218 45%, #0A3325 100%);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.keu-login.is-leaving {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.keu-login__backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.keu-login__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: keuOrbFloat 14s ease-in-out infinite;
}

.keu-login__orb--1 {
    width: 380px;
    height: 380px;
    top: -120px;
    right: -80px;
    background: rgba(16, 185, 129, 0.45);
}

.keu-login__orb--2 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -60px;
    background: rgba(20, 184, 166, 0.4);
    animation-delay: -5s;
}

.keu-login__orb--3 {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 12%;
    background: rgba(110, 231, 183, 0.28);
    animation-delay: -9s;
}

@keyframes keuOrbFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(30px, -30px, 0) scale(1.08); }
}

.keu-login__card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl, 24px);
    padding: 40px 36px 28px;
    box-shadow: 0 30px 80px -20px rgba(2, 24, 16, 0.55), 0 0 0 1px rgba(16, 185, 129, 0.08);
    animation: keuCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes keuCardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.keu-login__card.is-shaking {
    animation: keuShake 0.5s ease;
}

@keyframes keuShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

.keu-login__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.keu-login__logo img {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.keu-login__title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    color: var(--green-900, #064E3B);
    letter-spacing: -0.02em;
}

.keu-login__subtitle {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary, #475569);
    margin: 4px 0 18px;
}

.keu-login__shield {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--green-800, #065F46);
    background: var(--green-50, #ECFDF5);
    border: 1px solid var(--green-200, #A7F3D0);
    border-radius: var(--radius-md, 12px);
    padding: 10px 14px;
    margin-bottom: 22px;
}

.keu-login__shield svg {
    width: 26px;
    height: 26px;
    flex: none;
    color: var(--primary, #059669);
}

.keu-field {
    margin-bottom: 16px;
}

.keu-field__label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.keu-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.keu-field__icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-light, #94A3B8);
    pointer-events: none;
    transition: color var(--transition-fast, 0.2s ease);
}

.keu-field__wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    font-size: 14.5px;
    color: var(--text-primary, #0F172A);
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: var(--radius-md, 12px);
    transition: border-color var(--transition-fast, 0.2s ease), box-shadow var(--transition-fast, 0.2s ease), background var(--transition-fast, 0.2s ease);
}

.keu-field__wrap input:focus {
    background: #fff;
    border-color: var(--primary-light, #10B981);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.keu-field__wrap input:focus ~ .keu-field__icon,
.keu-field__wrap:focus-within .keu-field__icon {
    color: var(--primary, #059669);
}

.keu-field__toggle {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--text-light, #94A3B8);
    transition: color var(--transition-fast, 0.2s ease), background var(--transition-fast, 0.2s ease);
}

.keu-field__toggle:hover {
    color: var(--primary, #059669);
    background: var(--green-50, #ECFDF5);
}

.keu-field__toggle svg {
    width: 18px;
    height: 18px;
}

.keu-login__error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #B91C1C;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-md, 12px);
    padding: 10px 14px;
    margin-bottom: 16px;
    animation: keuFadeSlideDown 0.3s ease both;
}

.keu-login__submit {
    width: 100%;
    height: 50px;
    font-size: 15px;
}

.keu-login__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-light, #94A3B8);
}

/* ============================================================
   2. TOMBOL
   ============================================================ */

.keu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: var(--radius-md, 12px);
    padding: 0 16px;
    height: 40px;
    white-space: nowrap;
    transition: transform var(--transition-fast, 0.2s ease), box-shadow var(--transition-fast, 0.2s ease), background var(--transition-fast, 0.2s ease), color var(--transition-fast, 0.2s ease), border-color var(--transition-fast, 0.2s ease);
    border: 1.5px solid transparent;
}

.keu-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.keu-btn:active {
    transform: scale(0.97);
}

.keu-btn--primary {
    background: var(--primary-gradient, linear-gradient(135deg, #059669, #0D9488));
    color: #fff;
    box-shadow: var(--shadow-green, 0 8px 30px -4px rgba(5, 150, 105, 0.3));
}

.keu-btn--primary:hover {
    box-shadow: 0 10px 34px -6px rgba(5, 150, 105, 0.5);
    transform: translateY(-1px);
}

.keu-btn--excel {
    background: #0F6B44;
    color: #fff;
    box-shadow: 0 6px 20px -6px rgba(15, 107, 68, 0.55);
}

.keu-btn--excel:hover {
    background: #0C5937;
    transform: translateY(-1px);
}

.keu-btn--ghost {
    background: #fff;
    border-color: #E2E8F0;
    color: var(--text-secondary, #475569);
}

.keu-btn--ghost:hover {
    border-color: var(--green-300, #6EE7B7);
    color: var(--primary, #059669);
    background: var(--green-50, #ECFDF5);
}

.keu-btn--danger-ghost {
    background: #fff;
    border-color: #E2E8F0;
    color: #B91C1C;
}

.keu-btn--danger-ghost:hover {
    background: #FEF2F2;
    border-color: #FECACA;
}

.keu-btn--danger {
    background: #DC2626;
    color: #fff;
}

.keu-btn--danger:hover {
    background: #B91C1C;
}

.keu-btn[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

.keu-btn__spinner,
.keu-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: keuSpin 0.7s linear infinite;
}

@keyframes keuSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   3. TOPBAR
   ============================================================ */

.keu-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.keu-topbar__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.keu-topbar__brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.keu-topbar__brand strong {
    display: block;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 16px;
    font-weight: 800;
    color: var(--green-900, #064E3B);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.keu-topbar__brand span {
    display: block;
    font-size: 11.5px;
    color: var(--text-light, #94A3B8);
    font-weight: 500;
}

.keu-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   4. SHELL & TABS
   ============================================================ */

.keu-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 24px 40px;
}

.keu-tabs {
    display: flex;
    gap: 6px;
    background: #fff;
    border: 1px solid #E8EDF2;
    border-radius: var(--radius-lg, 16px);
    padding: 6px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: var(--shadow-sm);
    animation: keuFadeSlideDown 0.5s ease both;
}

.keu-tabs::-webkit-scrollbar {
    display: none;
}

.keu-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    border-radius: 11px;
    white-space: nowrap;
    transition: color var(--transition-fast, 0.2s ease), background var(--transition-fast, 0.2s ease), box-shadow var(--transition-fast, 0.2s ease);
}

.keu-tab svg {
    width: 16px;
    height: 16px;
}

.keu-tab:hover {
    color: var(--primary-dark, #047857);
    background: var(--green-50, #ECFDF5);
}

.keu-tab.is-active {
    color: #fff;
    background: var(--primary-gradient, linear-gradient(135deg, #059669, #0D9488));
    box-shadow: 0 6px 16px -4px rgba(5, 150, 105, 0.45);
}

.keu-tab__count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.keu-tab.is-active .keu-tab__count {
    background: rgba(255, 255, 255, 0.22);
}

/* ============================================================
   5. PANEL
   ============================================================ */

.keu-panel {
    display: none;
}

.keu-panel.is-active {
    display: block;
    animation: keuPanelIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

@keyframes keuFadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   6. KARTU STATISTIK
   ============================================================ */

.keu-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.keu-stat {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E8EDF2;
    border-radius: var(--radius-lg, 16px);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base, 0.3s ease), box-shadow var(--transition-base, 0.3s ease);
    animation: keuPanelIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--d, 0) * 70ms);
}

.keu-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.keu-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--primary-gradient));
    opacity: 0.9;
}

.keu-stat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.keu-stat__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    letter-spacing: 0.02em;
}

.keu-stat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--stat-icon-bg, var(--green-50));
    color: var(--stat-icon-fg, var(--primary));
    flex: none;
}

.keu-stat__icon svg {
    width: 20px;
    height: 20px;
}

.keu-stat__value {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary, #0F172A);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.keu-stat__sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light, #94A3B8);
    font-weight: 500;
}

.keu-stat__sub strong {
    color: var(--primary-dark, #047857);
    font-weight: 700;
}

/* ============================================================
   7. KARTU & GRID CHART
   ============================================================ */

.keu-card {
    background: #fff;
    border: 1px solid #E8EDF2;
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm);
}

.keu-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.keu-chart-card--wide {
    grid-column: 1 / -1;
}

/* ---- Ringkasan mini modul (dipakai panel Lahan) ---- */

.keu-mini-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.keu-mini-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #fff;
    border: 1px solid #E8EDF2;
    border-radius: var(--radius-md, 12px);
    padding: 14px 16px 13px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: keuPanelIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--d, 0) * 55ms);
}

.keu-mini-stat::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--mini-accent, #059669);
}

.keu-mini-stat--green  { --mini-accent: #059669; }
.keu-mini-stat--blue   { --mini-accent: #3B82F6; }
.keu-mini-stat--red    { --mini-accent: #EF4444; }
.keu-mini-stat--amber  { --mini-accent: #F59E0B; }
.keu-mini-stat--slate  { --mini-accent: #64748B; }

.keu-mini-stat__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light, #94A3B8);
}

.keu-mini-stat__value {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary, #0F172A);
    font-variant-numeric: tabular-nums;
}

.keu-mini-stat__sub {
    font-size: 11.5px;
    color: var(--text-secondary, #475569);
    font-weight: 500;
}

.keu-mini-stat__bar {
    display: block;
    height: 5px;
    margin: 5px 0 4px;
    background: #EEF2F6;
    border-radius: 99px;
    overflow: hidden;
}

.keu-mini-stat__bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #059669, #14B8A6);
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.keu-chart-card {
    padding: 20px 22px;
    animation: keuPanelIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--d, 0) * 90ms);
    transition: box-shadow var(--transition-base, 0.3s ease);
}

.keu-chart-card:hover {
    box-shadow: var(--shadow-md);
}

.keu-card__head {
    margin-bottom: 14px;
}

.keu-card__head h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
}

.keu-card__head p {
    font-size: 12px;
    color: var(--text-light, #94A3B8);
    margin-top: 2px;
}

.keu-chart-card__body {
    position: relative;
    height: 280px;
}

/* ============================================================
   8. PANEL MODUL DATA — TOOLBAR
   ============================================================ */

.keu-module__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.keu-module__title h2 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary, #0F172A);
}

.keu-module__title p {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin-top: 2px;
}

.keu-module__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-dark, #047857);
    background: var(--green-50, #ECFDF5);
    border: 1px solid var(--green-200, #A7F3D0);
    padding: 6px 12px;
    border-radius: 999px;
}

.keu-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #EEF2F6;
}

.keu-toolbar__search {
    position: relative;
    flex: 1 1 220px;
    max-width: 320px;
}

.keu-toolbar__search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-light, #94A3B8);
    pointer-events: none;
}

.keu-toolbar__search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    font-size: 13px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.keu-toolbar__search input:focus {
    background: #fff;
    border-color: var(--primary-light, #10B981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.keu-toolbar select,
.keu-toolbar input[type="date"] {
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary, #475569);
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.keu-toolbar select:focus,
.keu-toolbar input[type="date"]:focus {
    border-color: var(--primary-light, #10B981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.keu-toolbar__sep {
    width: 1px;
    height: 24px;
    background: #E8EDF2;
}

.keu-toolbar__reset {
    height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-light, #94A3B8);
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 6px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.keu-toolbar__reset.is-visible {
    display: inline-flex;
}

.keu-toolbar__reset:hover {
    color: #B91C1C;
    background: #FEF2F2;
}

.keu-toolbar__reset svg {
    width: 13px;
    height: 13px;
}

.keu-toolbar__spacer {
    flex: 1;
}

/* ============================================================
   9. TABEL DATA
   ============================================================ */

.keu-table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.keu-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    min-width: 760px;
}

.keu-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #F8FAFC;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary, #475569);
    padding: 12px 14px;
    border-bottom: 1.5px solid #E8EDF2;
    white-space: nowrap;
    user-select: none;
}

.keu-table thead th.is-sortable {
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.keu-table thead th.is-sortable:hover {
    color: var(--primary, #059669);
    background: var(--green-50, #ECFDF5);
}

.keu-table thead th .keu-sort {
    display: inline-block;
    margin-left: 5px;
    opacity: 0.4;
    font-size: 10px;
    transition: opacity var(--transition-fast);
}

.keu-table thead th.sorted-asc .keu-sort,
.keu-table thead th.sorted-desc .keu-sort {
    opacity: 1;
    color: var(--primary, #059669);
}

.keu-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-primary, #0F172A);
    vertical-align: middle;
    max-width: 320px;
}

.keu-table tbody tr {
    transition: background var(--transition-fast, 0.2s ease);
    animation: keuRowIn 0.35s ease both;
}

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

.keu-table tbody tr:hover {
    background: #F6FDF9;
}

.keu-table tbody tr.is-new {
    animation: keuRowFlash 1.6s ease both;
}

@keyframes keuRowFlash {
    0%   { background: var(--green-100, #D1FAE5); }
    100% { background: transparent; }
}

.keu-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.keu-table .muted {
    color: var(--text-light, #94A3B8);
}

/* Sel yang bisa diedit langsung */
.keu-cell--edit {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    transition: box-shadow var(--transition-fast), background var(--transition-fast);
}

.keu-cell--edit:hover {
    background: var(--green-50, #ECFDF5);
    box-shadow: inset 0 0 0 1.5px var(--green-300, #6EE7B7);
}

.keu-cell--edit:hover::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    opacity: 0.55;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.keu-cell--edit.is-editing {
    padding: 4px 6px !important;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--primary-light, #10B981), 0 4px 12px -2px rgba(5, 150, 105, 0.25);
}

.keu-cell--edit.is-editing::after {
    display: none;
}

.keu-cell__input {
    width: 100%;
    min-width: 90px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary, #0F172A);
    background: #fff;
    border: none;
    border-radius: 6px;
}

.keu-cell--saving {
    opacity: 0.45;
    pointer-events: none;
}

/* Badge status */
.keu-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.keu-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.75;
}

.keu-badge--green  { color: #047857; background: #ECFDF5; }
.keu-badge--amber  { color: #B45309; background: #FFFBEB; }
.keu-badge--blue   { color: #1D4ED8; background: #EFF6FF; }
.keu-badge--red    { color: #B91C1C; background: #FEF2F2; }
.keu-badge--purple { color: #7E22CE; background: #FAF5FF; }
.keu-badge--slate  { color: #475569; background: #F1F5F9; }

/* Progress bar kecil (persentase konstruksi) */
.keu-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.keu-progress__track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: #EEF2F6;
    overflow: hidden;
}

.keu-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary-gradient, linear-gradient(135deg, #059669, #0D9488));
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.keu-progress__label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-dark, #047857);
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: right;
}

/* Tombol aksi baris */
.keu-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.keu-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--text-light, #94A3B8);
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.keu-icon-btn svg {
    width: 15px;
    height: 15px;
}

.keu-icon-btn:hover {
    transform: scale(1.08);
}

.keu-icon-btn--edit:hover {
    color: var(--primary, #059669);
    background: var(--green-50, #ECFDF5);
}

.keu-icon-btn--delete:hover {
    color: #DC2626;
    background: #FEF2F2;
}

/* Keadaan kosong */
.keu-empty {
    padding: 56px 24px;
    text-align: center;
    color: var(--text-light, #94A3B8);
}

.keu-empty svg {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

.keu-empty strong {
    display: block;
    font-size: 14.5px;
    color: var(--text-secondary, #475569);
    margin-bottom: 4px;
}

.keu-empty p {
    font-size: 12.5px;
}

/* ============================================================
   10. PAGINATION
   ============================================================ */

.keu-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #EEF2F6;
    flex-wrap: wrap;
}

.keu-pagination__info {
    font-size: 12.5px;
    color: var(--text-light, #94A3B8);
}

.keu-pagination__info strong {
    color: var(--text-secondary, #475569);
}

.keu-pagination__nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.keu-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    border-radius: 9px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.keu-page-btn:hover {
    background: var(--green-50, #ECFDF5);
    color: var(--primary-dark, #047857);
}

.keu-page-btn.is-active {
    background: var(--primary, #059669);
    color: #fff;
}

.keu-page-btn[disabled] {
    opacity: 0.35;
    pointer-events: none;
}

.keu-pagination select {
    height: 32px;
    font-size: 12px;
    padding: 0 8px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    color: var(--text-secondary, #475569);
    cursor: pointer;
}

/* ============================================================
   11. MODAL
   ============================================================ */

.keu-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.keu-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 21, 15, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: keuFadeIn 0.25s ease both;
}

@keyframes keuFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.keu-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: min(86vh, 720px);
    overflow-y: auto;
    background: #fff;
    border-radius: var(--radius-xl, 24px);
    box-shadow: 0 30px 80px -20px rgba(2, 24, 16, 0.45);
    animation: keuModalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes keuModalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.keu-modal__head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 14px;
    background: #fff;
    border-bottom: 1px solid #EEF2F6;
}

.keu-modal__head h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
}

.keu-modal__head p {
    font-size: 12px;
    color: var(--text-light, #94A3B8);
    margin-top: 2px;
}

.keu-modal__close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-light, #94A3B8);
    transition: background var(--transition-fast), color var(--transition-fast);
    flex: none;
}

.keu-modal__close:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.keu-modal__close svg {
    width: 17px;
    height: 17px;
}

.keu-modal__body {
    padding: 20px 24px;
}

.keu-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}

.keu-form-grid .keu-field {
    margin-bottom: 0;
}

.keu-form-grid .keu-field--full {
    grid-column: 1 / -1;
}

.keu-field select,
.keu-field input[type="date"],
.keu-field input[type="text"],
.keu-field input[type="number"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-size: 13.5px;
    color: var(--text-primary, #0F172A);
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: var(--radius-md, 12px);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.keu-field select:focus,
.keu-field input:focus {
    background: #fff;
    border-color: var(--primary-light, #10B981);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.keu-modal__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px 20px;
    background: #fff;
    border-top: 1px solid #EEF2F6;
}

.keu-modal__confirm-body {
    padding: 26px 24px;
    text-align: center;
}

.keu-modal__confirm-body .keu-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    color: #DC2626;
}

.keu-modal__confirm-body .keu-confirm-icon svg {
    width: 26px;
    height: 26px;
}

.keu-modal__confirm-body h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 17px;
    font-weight: 800;
}

.keu-modal__confirm-body p {
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin-top: 6px;
    line-height: 1.6;
}

/* ============================================================
   12. TOAST
   ============================================================ */

.keu-toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.keu-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 360px;
    background: #fff;
    border: 1px solid #E8EDF2;
    border-left: 4px solid var(--primary, #059669);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #0F172A);
    box-shadow: var(--shadow-lg);
    animation: keuToastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    pointer-events: auto;
}

.keu-toast.is-leaving {
    animation: keuToastOut 0.3s ease both;
}

@keyframes keuToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes keuToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

.keu-toast--error {
    border-left-color: #DC2626;
}

.keu-toast__icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--primary, #059669);
}

.keu-toast--error .keu-toast__icon {
    color: #DC2626;
}

/* ============================================================
   13. SKELETON LOADING
   ============================================================ */

.keu-skeleton {
    position: relative;
    overflow: hidden;
    background: #EEF2F6;
    border-radius: 8px;
}

.keu-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: keuShimmer 1.4s infinite;
}

@keyframes keuShimmer {
    100% { transform: translateX(100%); }
}

/* ============================================================
   14. FOOTER & RESPONSIVE
   ============================================================ */

.keu-foot {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light, #94A3B8);
}

@media (max-width: 1024px) {
    .keu-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .keu-charts {
        grid-template-columns: 1fr;
    }
    .keu-mini-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .keu-shell {
        padding: 16px 14px 32px;
    }
    .keu-topbar__inner {
        padding: 10px 14px;
    }
    .keu-hide-sm {
        display: none;
    }
    .keu-stats {
        grid-template-columns: 1fr;
    }
    .keu-mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .keu-form-grid {
        grid-template-columns: 1fr;
    }
    .keu-topbar__brand strong {
        font-size: 14px;
    }
    .keu-login__card {
        padding: 30px 22px 22px;
    }
    .keu-chart-card__body {
        height: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .keu-body *,
    .keu-body *::before,
    .keu-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
