/* ===============================
   RESET & BASE
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fb;
    color: #111827;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===============================
   DASHBOARD
================================ */
.container {
    width: 100%;
    max-width: none;
    padding: 32px;
}

.dashboard-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.main {
    flex: 1;
    min-width: 0;
}



.dash-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.dash-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 6px;
}

.dash-value {
    font-size: 28px;
    font-weight: 700;
}

.dash-sub {
    margin-top: 6px;
    font-size: 13px;
}

.dash-sub.positive { color: #16a34a; }
.dash-sub.negative { color: #dc2626; }
.dash-sub.neutral  { color: #6b7280; }

.dash-value.muted {
    color: #cbd5e1;
}


/* RESPONSIVE */
@media (max-width: 900px) {
    .dashboard-highlights {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   LAYOUT
================================ */
.app {
    display: flex;
    min-height: 100vh;
}


/* ===============================
   MAIN AREA
================================ */
.main {
    margin-left: 72px;
    width: calc(100% - 72px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===============================
   TOPBAR
================================ */
.topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar .title {
    font-size: 16px;
    font-weight: 600;
}

.topbar .user {
    font-size: 14px;
    color: #6b7280;
}


/* ===============================
   GRID (GLOBAL)
================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

/* ===============================
   CARD (GLOBAL)
================================ */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 24px; }

.muted {
    color: #6b7280;
    font-size: 13px;
}

/* ===============================
   FORM & BUTTON
================================ */
input,
select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #0033ff;
}

.btn-primary {
    background: #0033ff;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
}

.btn-secondary {
    background: #eef2ff;
    color: #0033ff;
    padding: 10px 16px;
    border-radius: 10px;
}

/* ===============================
   STATUS
================================ */
.status-on {
    color: #16a34a;
    font-weight: 600;
}

.status-off {
    color: #dc2626;
    font-weight: 600;
}

/* ===============================
   USER GRID (SAAS)
================================ */
.user-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

/* ===============================
   USER CARD (SAAS STYLE)
================================ */
.user-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,.04);
    overflow: hidden;
    transition:
        box-shadow .25s ease,
        transform .25s ease;
}

.user-card:hover {
    box-shadow: 0 14px 32px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

.user-card.active {
    box-shadow: 0 16px 36px rgba(0,0,0,.10);
}

/* ===============================
   USER HEADER
================================ */
.user-header {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
}

.user-header:hover {
    background: #f9fafb;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===============================
   USER DETAIL (ACCORDION)
================================ */
.user-detail {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 18px;
    transform: translateY(-4px);
    transition:
        max-height .35s ease,
        opacity .25s ease,
        transform .25s ease;
}

.user-detail.open {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
    padding-bottom: 18px;
}

/* ===============================
   PERMISSION GRID
================================ */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.perm-item {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 1024px) {
    .grid,
    .user-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid,
    .user-grid {
        grid-template-columns: 1fr;
    }
}
.status-toggle {
    position: relative;
    width: 42px;
    height: 22px;
}

.status-toggle input {
    display: none;
}

.status-toggle .slider {
    position: absolute;
    inset: 0;
    background: #e5e7eb;
    border-radius: 999px;
    cursor: pointer;
    transition: .25s;
}

.status-toggle .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
}

.status-toggle input:checked + .slider {
    background: #22c55e;
}

.status-toggle input:checked + .slider::before {
    transform: translateX(20px);
}
/* ===============================
   ICON BUTTON (ADD USER)
================================ */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0px solid #e5e7eb;
    background: #0033ff;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all .2s ease;
}

.icon-btn:hover {
    background: #eef2ff;
    color: #0033ff;
    outline-width: 1px;
    border-color: #0033ff;
}

.icon-btn:active {
    transform: scale(.95);
}
/* FLOATING ADD USER BUTTON */
.fab-add-user {
    position: absolute;
    top: 0;
    right: 0;

    width: 44px;
    height: 44px;
    border-radius: 14px;

    background: #0033ff;
    color: #fff;
    font-size: 22px;
    font-weight: 600;

    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 10px 25px rgba(0,51,255,.35);
    transition: transform .2s ease, box-shadow .2s ease;

    z-index: 20;
}

.fab-add-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,51,255,.45);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .add-user-form {
        grid-template-columns: 1fr;
    }

    .add-user-actions {
        justify-content: flex-end;
    }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .add-user-form {
        grid-template-columns: 1fr;
    }

    .add-user-action {
        justify-content: flex-end;
    }
}
/* ===============================
   MODAL ADD USER
================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,.25);
    animation: modalFade .2s ease;
}

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

/* HEADER */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* FORM */
.modal-card input {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0 14px;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ACTION */
.modal-action {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}
.fab-add-user {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #0033ff;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,51,255,.35);
}

.user-grid {
    margin-top: 72px;
}
/* ===============================
   GLOBAL BUTTON SYSTEM
   OLA KPI SYSTEM
================================ */

/* BASE BUTTON */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 40px;
    padding: 0 16px;

    border-radius: 12px;
    border: none;
    outline: none;

    font-size: 14px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    user-select: none;

    background: transparent;
    color: inherit;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.btn:focus,
.btn:active {
    outline: none;
    box-shadow: none;
}

/* ===============================
   PRIMARY
================================ */
.btn-primary {
    background: #0033ff;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1e40ff;
    transform: translateY(-1px);
}

/* ===============================
   SECONDARY
================================ */
.btn-secondary {
    background: #eef2ff;
    color: #0033ff;
}

.btn-secondary:hover {
    background: #e0e7ff;
}

/* ===============================
   TEXT BUTTON
================================ */
.btn-text {
    padding: 0 8px;
    height: 32px;
    color: #6b7280;
    font-weight: 600;
}

.btn-text:hover {
    color: #111827;
}

/* ===============================
   ICON BUTTON ( + , ✕ , dll )
================================ */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;

    border-radius: 12px;

    background: #0033ff;
    color: #ffffff;

    font-size: 22px;
    font-weight: 600;
}

.btn-icon:hover {
    background: #1e40ff;
    transform: translateY(-1px);
}


.report-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* MOBILE */
@media (max-width: 900px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}


/* ===============================
   SPLITBAR
================================ */

/* FORCE KPI CARD LAYOUT */
.week-card-kpi{
    background:#fff;
    border-radius:16px;
    padding:20px;
    display:grid;
    grid-template-columns:72px 1fr;
    column-gap:16px;
    box-shadow:0 6px 16px rgba(0,0,0,.05);
}

/* LEFT SIDE */
.kpi-left{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
}

.kpi-avatar{
    width:56px;
    height:56px;
    border-radius:50%;
    object-fit:cover;
}

/* KPI BELOW AVATAR */
.kpi-mini-bar{
    width:100%;
    height:4px;                 /* bikin lebih kelihatan full */
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
    position:relative;
}

.kpi-mini-bar span{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    display:block;
    transform-origin:left;
}
.kpi-mini-bar span{
    transition: transform .4s ease;
}
.kpi-left{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    width:100%;          /* ⬅️ INI KUNCI UTAMA */
}
.week-card-kpi{
    align-items: stretch; /* pastiin kolom full */
}


/* ===============================
   FORM D – WEEK GRID (FIX)
================================ */
.week-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
    align-items: start;
}
/* ===============================
   KPI CLEAN FINAL
================================ */
.kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.kpi-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.kpi-meta-text {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    margin-left: 6px;
}

.kpi-desc {
    font-size: 12px;
    color: #6b7280;
}

.kpi-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kpi-weight {
    width: 110px;
    height: 4px;
}

.kpi-percent {
    width: 36px;
    font-size: 12px;
    text-align: right;
}

.kpi-delete {
    color: #dc2626;
    text-decoration: none;
    font-size: 14px;
}

/* ===============================
   ADD KPI FORM COMPACT
================================ */
.inline-form {
    display: grid;
    grid-template-columns:
        1.2fr
        1.6fr
        0.6fr
        0.8fr
        0.5fr
        auto;
    gap: 8px;
    margin-top: 12px;
}

.inline-form input,
.inline-form select {
    height: 34px;
    font-size: 12px;
}
.role-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.role-card-header {
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* ===============================
   RANGE SLIDER UX
================================ */
.kpi-weight {
    width: 500px;   /* sebelumnya ±100 */
    height: 2px;
    cursor: pointer;
}

/* Thumb (Chrome / Edge) */
.kpi-weight::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
}

/* Thumb (Firefox) */
.kpi-weight::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
}
/* ===============================
   FORCE ROLE GRID (FINAL)
================================ */
.role-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
    align-items: start;
}
@media (max-width: 1100px) {
    .role-grid {
        grid-template-columns: 1fr !important;
    }
}
/* ===============================
   ROLE CARD SPACING (FINAL)
================================ */

/* jarak header ke isi */
.role-card-header {
    margin-bottom: 16px;
}

/* jarak antar KPI */
.kpi-row {
    padding: 14px 0;
}

/* jarak KPI terakhir ke form */
.role-card-body > .inline-form {
    margin-top: 20px;
}

/* pisahkan antar role card secara visual */
.role-card {
    margin-bottom: 8px; /* kecil aja, grid tetap pegang jarak utama */
}
.password-wrap{
    position:relative;
}

.password-wrap input{
    width:100%;
    padding-right:42px;
}

.toggle-pass{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    border:none;
    background:transparent;
    cursor:pointer;
    font-size:14px;
    color:#6b7280;
}

.toggle-pass:hover{
    color:#111827;
}


/* ===============================
   REPORTS UI FIX
================================ */

/* SELECT CARD */
.card-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.select-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s ease;
    background: #fff;
}

.select-card:hover {
    border-color: #2563eb;
}

.select-card.active {
    border-color: #2563eb;
    background: #eff6ff;
}

/* GRID 2 FIX */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* PREVIEW BOX */
.preview {
    background: #f9fafb;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}

.preview th {
    text-align: left;
    color: #6b7280;
    padding-bottom: 6px;
}

.preview td {
    padding: 6px 0;
    border-top: 1px dashed #e5e7eb;
}

/* EXPORT ACTION */
.export-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}


