﻿/* --- Global --- */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* --- Blazor Error UI --- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url('/background.svg') no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* --- 🧱 Global Card Styling (semua halaman) --- */
.card {
    border-radius: 0.9rem;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .card:hover {
        background-color: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 6px 12px rgba(0, 0, 0, 0.04);
    }

    /* --- Chart Card --- */
    .card.chart-card {
        border-radius: 0.9rem;
        padding: 1.25rem !important;
        height: 400px;
        width: 100%;
        max-width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

        .card.chart-card:hover {
            box-shadow: 0 4px 16px rgba(0, 115, 255, 0.08);
        }

    /* --- Typography --- */
    .card h6.text-muted {
        font-size: 0.9rem;
        color: #6c757d;
    }

    .card h3.fw-bold {
        font-size: 1.75rem;
        color: #212529;
    }

/* --- Login --- */
.login-card {
    padding: 2rem;
    border-radius: 0.9rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    background-color: #fff;
    z-index: 1;
}

/* --- Authentication Layout --- */
.authentication-wrapper.authentication-basic {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

    .authentication-wrapper.authentication-basic .authentication-inner {
        max-width: 500px;
        width: 100%;
        position: relative;
    }

/* --- Logo --- */
.logo-wrapper, .brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    margin: 0 auto 1rem auto;
}

.logo-wrapper {
    width: 60px;
    height: 60px;
}

.brand-logo {
    width: 100px;
    height: 100px;
}

    .brand-logo img {
        width: auto;
        height: 85%;
        object-fit: contain;
    }

/* --- Tables & Pagination --- */
.table th {
    vertical-align: middle !important;
    text-align: center;
}

.pagination-controls button {
    min-width: 80px;
}

/* --- Dashboard Cards --- */
.dashboard-page .card {
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,115,255,0.1);
    transition: background-color 0.25s ease, box-shadow 0.3s ease;
}

    .dashboard-page .card:hover {
        background-color: #f8fbff;
        box-shadow: 0 8px 24px rgba(0,115,255,0.25);
        border: 1px solid rgba(0,115,255,0.2);
    }

/* ==========================================================
   🌳 PERFECT ORG CHART (scrollable, clean, and accurate lines)
   ========================================================== */

/* ORG-CHART: scoped, branch-based connectors */

/* 🌳 TRUE HIERARCHICAL ORG CHART (with clean connectors) */

/* ==========================================================
   🌳 ORG CHART (clean lines, responsive, vertical fixed)
   ========================================================== */

.org-chart-container {
    position: relative;
    padding: 3rem 2rem;
    overflow: auto;
    white-space: nowrap;
    background: #f8fafc;
    border-radius: 10px;
    min-height: 500px;
    text-align: center;
}

/* --- Base Branch Structure --- */
.org-branch {
    display: inline-block;
    position: relative;
    text-align: center;
    vertical-align: top;
    margin: 0 2rem;
}

.org-node {
    position: relative;
    display: inline-block;
    z-index: 2;
}

.org-card {
    display: inline-block;
    min-width: 160px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

    .org-card:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    }

/* --- Connectors (Horizontal Layout) --- */
.org-node.has-children::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    width: 2px;
    height: 22px;
    background: #4caf50;
    transform: translateX(-50%);
}

.org-children {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2.5rem;
    margin: 0 auto;
    margin-top: 2.5rem;
    padding-top: 25px;
    width: -moz-fit-content;
    width: fit-content;
}

    .org-children::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background: #4caf50;
    }

    .org-children:only-child::before,
    .org-children:empty::before {
        display: none;
    }

    .org-children > .org-branch {
        display: block;
        position: relative;
    }

        .org-children > .org-branch > .org-node::before {
            content: '';
            position: absolute;
            top: -22px;
            left: 50%;
            width: 2px;
            height: 22px;
            background: #4caf50;
            transform: translateX(-50%);
        }

/* --- Typography --- */
.org-card .fw-bold {
    color: #0071c1;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.org-card .small {
    color: #555;
    font-size: 0.85rem;
}

.org-card .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 4px;
    background: #4caf50;
    color: white;
}

/* --- Highlighted Node --- */
.org-card.highlight {
    box-shadow: 0 6px 18px rgba(255,165,0,0.25);
    border: 2px solid #ff9800;
    transform: translateY(-2px);
}

/* ==========================================================
   🔄 VERTICAL MODE (fixed)
   ========================================================== */

/* ==========================================================
   🌳 ORG VERTICAL FIX — with full vertical connector line
   ========================================================== */

.org-vertical {
    white-space: normal;
}

    .org-vertical .org-chart-container {
        text-align: left;
    }

    /* --- Branch: parent + anak --- */
    .org-vertical .org-branch {
        display: flex;
        align-items: center;
        flex-direction: row;
        position: relative;
        margin: 1rem 0;
    }

    /* --- Node utama --- */
    .org-vertical .org-node {
        position: relative;
        display: inline-block;
        margin-right: 3rem;
        z-index: 2;
    }

        /* --- Garis horizontal dari parent ke batang vertikal anak (dipanjangkan sampai nempel) --- */
        .org-vertical .org-node.has-children::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 100%;
            width: 90px; /* panjangkan dari 40px → 80px agar nempel ke garis vertikal */
            height: 2px;
            background: #4caf50;
            transform: translateY(-50%);
        }



    /* --- Container anak di kanan --- */
    .org-vertical .org-children {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
        margin-left: 80px;
        padding-left: 0;
    }

        /* --- Garis vertikal utama (nyambung antar anak) --- */
        .org-vertical .org-children::before {
            content: '';
            position: absolute;
            left: -40px;
            top: 1rem; /* mulai sedikit di bawah parent */
            height: calc(100% - 2rem); /* menyesuaikan jarak antar anak */
            width: 2px;
            background: #4caf50;
        }

        /* --- Jika hanya satu anak, hapus garis vertikal --- */
        .org-vertical .org-children:only-child::before,
        .org-vertical .org-children:empty::before {
            display: none;
        }

        /* --- Garis horizontal kecil ke tiap anak --- */
        .org-vertical .org-children > .org-branch::before {
            content: '';
            position: absolute;
            left: -40px;
            top: 50%;
            width: 40px;
            height: 2px;
            background: #4caf50;
            transform: translateY(-50%);
        }

        /* --- Hilangkan konektor lama --- */
        .org-vertical .org-children > .org-branch > .org-node::before {
            display: none;
        }

    /* --- Node card style --- */
    .org-vertical .org-card {
        min-width: 160px;
        text-align: left;
    }

        /* --- Hover efek --- */
        .org-vertical .org-card:hover {
            transform: scale(1.03);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

/* --- Responsif --- */
@media (max-width: 768px) {
    .org-vertical .org-card {
        min-width: 140px;
    }

    .org-vertical .org-node.has-children::after {
        right: -25px;
        width: 25px;
    }

    .org-vertical .org-children {
        margin-left: 55px;
        gap: 1.5rem;
    }

        .org-vertical .org-children::before {
            left: -25px;
        }

        .org-vertical .org-children > .org-branch::before {
            left: -25px;
            width: 25px;
        }
}


/* --- Collapse button --- */
.org-card .btn-collapse {
    padding: 0.12rem 0.45rem;
    font-size: 0.78rem;
    line-height: 1;
    border-radius: 6px;
}

/* --- Suggestions Dropdown --- */
.list-group.position-absolute {
    max-height: 260px;
    overflow-y: auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .org-card {
        min-width: 130px;
        padding: 10px;
    }

    .org-branch {
        margin: 0 1rem;
    }

    .org-children {
        gap: 1rem;
        padding-top: 20px;
        margin-top: 2rem;
    }

        .org-node.has-children::after,
        .org-children > .org-branch > .org-node::before {
            height: 18px;
        }
}
/* ==========================================================
   🧩 Hide connectors when collapsed
   ========================================================== */

/* Saat parent collapse → sembunyikan garis horizontal dari parent */
.org-vertical .org-node.has-children.collapsed::after {
    display: none !important;
}

/* Saat parent collapse → sembunyikan garis vertikal penghubung ke anak */
.org-vertical .org-node.has-children.collapsed + .org-children::before {
    display: none !important;
}

/* Saat parent collapse → sembunyikan semua garis horizontal ke tiap anak */
.org-vertical .org-node.has-children.collapsed + .org-children > .org-branch::before {
    display: none !important;
}
/* ==========================================================
   🧩 Hide connectors when collapsed — HORIZONTAL MODE
   ========================================================== */

/* Garis vertikal dari parent ke anak */
.org-node.has-children.collapsed::after {
    display: none !important;
}

/* Garis horizontal utama penghubung antar anak */
.org-children.collapsed::before {
    display: none !important;
}

/* Garis vertikal kecil dari batang utama ke tiap anak */
.org-children.collapsed > .org-branch > .org-node::before {
    display: none !important;
}
/* --- Zoom Wrapper --- */
.org-zoom-wrapper {
    transform-origin: center center;
    transition: transform 0.25s ease;
}

/* --- Pan Cursor --- */
.org-chart-container {
    cursor: grab;
}

    .org-chart-container:active {
        cursor: grabbing;
    }
    /* Saat drag aktif */
    .org-chart-container.panning {
        cursor: grabbing !important;
    }
/* --- Zoom Wrapper FIX --- */
.org-zoom-wrapper {
    display: inline-block; /* penting agar ukuran mengikuti skala */
    transform-origin: top left; /* zoom dimulai dari pojok kiri atas */
    will-change: transform; /* agar browser optimasi rendering */
    transition: transform 0.25s ease;
}

/* Saat di-zoom besar, pastikan kontainer masih bisa di-scroll */
.org-chart-container {
    overflow: scroll !important;
    touch-action: none; /* biar tidak bentrok gesture di trackpad / mobile */
}
