
/* =========================================================
   =========================================================
   BIMWORKS.ID
   MODE MANAGER + MODE DIREKSI
   CONTROL BUTTON SYSTEM
   =========================================================
   ========================================================= */


/* =========================================================
   SHARED MODE BUTTON
   ========================================================= */

.manager-mode-button,
.director-mode-button {

    position: fixed;

    top: 40px;

    z-index: 99999;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 7px 15px 7px 7px;

    box-sizing: border-box;

    background:
        linear-gradient(
            135deg,
            rgba(15,15,15,.97),
            rgba(35,35,35,.97)
        );

    border:
        1px solid
        rgba(255,255,255,.18);

    border-radius: 50px;

    box-shadow:
        0 10px 35px
        rgba(0,0,0,.45);

    cursor: pointer;

    color: white;

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);

    user-select: none;

    -webkit-tap-highlight-color:
        transparent;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}


/* =========================================================
   MANAGER POSITION
   ========================================================= */

.manager-mode-button {

    left: 40px;
    right: auto;

}


/* =========================================================
   DIRECTOR POSITION
   ========================================================= */

.director-mode-button {

    right: 40px;
    left: auto;

}


/* =========================================================
   HOVER
   ========================================================= */

.manager-mode-button:hover,
.director-mode-button:hover {

    transform:
        translateY(-3px)
        scale(1.02);

    box-shadow:
        0 15px 45px
        rgba(0,0,0,.6);

    border-color:
        rgba(255,255,255,.4);
}


/* =========================================================
   ACTIVE / TOUCH
   ========================================================= */

.manager-mode-button:active,
.director-mode-button:active {

    transform:
        scale(.96);
}


/* =========================================================
   MANAGER AVATAR
   ========================================================= */

.manager-avatar {

    width: 52px;
    height: 52px;

    position: relative;

    overflow: hidden;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #222,
            #555
        );

    border:
        2px solid
        rgba(255,255,255,.7);

    flex-shrink: 0;
}


.manager-avatar img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


.manager-avatar span {

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 24px;

    pointer-events: none;
}


/* =========================================================
   DIRECTOR AVATAR
   ========================================================= */

.director-avatar {

    width: 52px;
    height: 52px;

    position: relative;

    overflow: hidden;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #222,
            #555
        );

    border:
        2px solid
        rgba(255,255,255,.7);

    flex-shrink: 0;
}


.director-avatar img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


.director-avatar span {

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 24px;

    pointer-events: none;
}


/* =========================================================
   MANAGER LABEL
   ========================================================= */

.manager-label {

    display: flex;

    flex-direction: column;

    justify-content: center;

    line-height: 1.15;

    min-width: 0;
}


.manager-label strong {

    font-size: 12px;

    letter-spacing: 1px;

    white-space: nowrap;
}


.manager-label small {

    margin-top: 4px;

    font-size: 10px;

    opacity: .6;

    white-space: nowrap;
}


/* =========================================================
   DIRECTOR LABEL
   ========================================================= */

.director-label {

    display: flex;

    flex-direction: column;

    justify-content: center;

    line-height: 1.15;

    min-width: 0;
}


.director-label strong {

    font-size: 12px;

    letter-spacing: 1px;

    white-space: nowrap;
}


.director-label small {

    margin-top: 4px;

    font-size: 10px;

    opacity: .6;

    white-space: nowrap;
}


/* =========================================================
   =========================================================
   MANAGER POPUP
   =========================================================
   ========================================================= */


/* =========================================================
   MANAGER POPUP OVERLAY
   ========================================================= */

.manager-popup {

    position: fixed;

    inset: 0;

    z-index: 100000;

    display: none;

    align-items: center;
    justify-content: center;

    background:
        rgba(0,0,0,.72);

    backdrop-filter:
        blur(8px);

    -webkit-backdrop-filter:
        blur(8px);
}


.manager-popup.active {

    display: flex;
}


/* =========================================================
   MANAGER POPUP CONTAINER
   ========================================================= */

.manager-popup-container {

    position: relative;

    width: 96vw;
    height: 94vh;

    max-width: 1800px;

    overflow: hidden;

    border-radius: 18px;

    background: #050505;

    border:
        1px solid
        rgba(255,255,255,.15);

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.75);
}


/* =========================================================
   MANAGER POPUP HEADER
   ========================================================= */

.manager-popup-header {

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 16px;

    color: #fff;

    background:
        linear-gradient(
            90deg,
            #050505,
            #111,
            #050505
        );

    border-bottom:
        1px solid
        rgba(255,255,255,.12);
}


.manager-popup-title {

    display: flex;

    align-items: center;

    gap: 10px;

    font-size: 13px;

    font-weight: 700;

    letter-spacing: .4px;
}


.manager-popup-status {

    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    border-radius: 50%;

    background: #00ff88;

    box-shadow:
        0 0 12px
        #00ff88;
}


/* =========================================================
   MANAGER CLOSE
   ========================================================= */

.manager-popup-close {

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 8px;

    background:
        rgba(255,255,255,.06);

    color: #fff;

    font-size: 22px;

    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;
}


.manager-popup-close:hover {

    background:
        rgba(255,255,255,.15);

    transform:
        scale(1.05);
}


/* =========================================================
   MANAGER IFRAME
   ========================================================= */

#managerFrame {

    display: block;

    width: 100%;

    height:
        calc(100% - 48px);

    border: 0;

    background: #050505;
}


/* =========================================================
   =========================================================
   DIRECTOR OVERLAY
   =========================================================
   ========================================================= */

.director-overlay {

    position: fixed;

    inset: 0;

    z-index: 100000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0,0,0,.72);

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);

    opacity: 0;

    transition:
        opacity .3s ease;
}


.director-overlay.active {

    display: flex;

    opacity: 1;
}


/* =========================================================
   DIRECTOR PANEL
   ========================================================= */

.director-panel {

    width:
        min(1000px, 95vw);

    max-height:
        90vh;

    overflow-y: auto;

    overflow-x: hidden;

    background:
        linear-gradient(
            145deg,
            #111,
            #1b1b1b
        );

    border:
        1px solid
        rgba(255,255,255,.15);

    border-radius: 22px;

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.65);

    color: white;

    transform:
        translateY(20px)
        scale(.97);

    transition:
        transform .3s ease;

    scrollbar-width: thin;

    overscroll-behavior:
        contain;
}


.director-overlay.active
.director-panel {

    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   DIRECTOR HEADER
   ========================================================= */

.director-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding:
        22px 28px;

    border-top:
        1px solid
        rgba(255,255,255,.1);
}


.director-title {

    font-size: 18px;

    font-weight: 700;

    letter-spacing: 1.5px;
}


.director-subtitle {

    margin-top: 5px;

    font-size: 12px;

    opacity: .55;
}


.director-close {

    width: 40px;
    height: 40px;

    min-width: 40px;

    border: none;

    border-radius: 50%;

    background:
        rgba(255,255,255,.08);

    color: white;

    font-size: 25px;

    cursor: pointer;

    transition: .2s;
}


.director-close:hover {

    background:
        rgba(255,255,255,.18);

    transform:
        rotate(90deg);
}


/* =========================================================
   DIRECTOR KPI
   ========================================================= */

.director-kpi-grid {

    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap: 14px;

    padding:
        24px 28px;
}


.director-kpi {

    min-width: 0;

    padding: 18px;

    border-radius: 15px;

    background:
        rgba(255,255,255,.055);

    border:
        1px solid
        rgba(255,255,255,.08);
}


.director-kpi span {

    display: block;

    font-size: 10px;

    letter-spacing: 1px;

    opacity: .5;

    margin-top: 8px;
}


.director-kpi strong {

    display: block;

    font-size: 21px;

    line-height: 1.2;

    overflow-wrap: anywhere;
}


.status-active {

    color: #42e695;
}


/* =========================================================
   DIRECTOR SUMMARY
   ========================================================= */

.director-summary {

    display: flex;

    align-items: flex-start;

    gap: 20px;

    margin:
        0 28px 24px;

    padding: 22px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.07),
            rgba(255,255,255,.025)
        );
}


.summary-avatar {

    width: 90px;
    height: 90px;

    overflow: hidden;

    border-radius: 18px;

    background:
        #222;

    flex-shrink: 0;
}


.summary-avatar img {

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.summary-content {

    min-width: 0;
}


.summary-content h3 {

    margin:
        0 0 8px;

    font-size: 17px;
}


.summary-content p {

    margin:
        5px 0;

    font-size: 13px;

    line-height: 1.6;

    opacity: .65;
}


/* =========================================================
   DIRECTOR SECTION
   ========================================================= */

.director-section {

    padding:
        0 28px 25px;
}


.director-section-title {

    font-size: 11px;

    letter-spacing: 1.5px;

    opacity: .45;

    margin-top: 13px;
}


/* =========================================================
   DIRECTOR PRIORITY
   ========================================================= */

.director-priority-grid {

    display: grid;

    grid-template-columns:
        repeat(2,1fr);

    gap: 10px;
}


.priority-item {

    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;

    padding: 15px;

    border-radius: 13px;

    background:
        rgba(255,255,255,.045);

    border:
        1px solid
        rgba(255,255,255,.06);

    transition: .2s;
}


.priority-item:hover {

    background:
        rgba(255,255,255,.09);

    transform:
        translateY(-2px);
}


.priority-icon {

    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        rgba(255,255,255,.08);

    font-size: 18px;
}


.priority-item strong {

    display: block;

    font-size: 13px;

    overflow-wrap: anywhere;
}


.priority-item small {

    display: block;

    margin-top: 3px;

    font-size: 10px;

    opacity: .45;
}


/* =========================================================
   DIRECTOR ACTIONS
   ========================================================= */

.director-actions {

    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap: 10px;
}


.director-action {

    min-width: 0;

    min-height: 80px;

    padding:
        15px 10px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 8px;

    text-align: center;

    border-radius: 13px;

    color: white;

    text-decoration: none;

    background:
        rgba(255,255,255,.05);

    border:
        1px solid
        rgba(255,255,255,.07);

    font-size: 12px;

    transition: .2s;
}


.director-action:hover {

    background:
        rgba(255,255,255,.12);

    transform:
        translateY(-3px);
}


/* =========================================================
   DIRECTOR FOOTER
   ========================================================= */

.director-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;

    padding:
        15px 28px;

    border-top:
        1px solid
        rgba(255,255,255,.08);

    font-size: 10px;

    opacity: .35;
}


/* =========================================================
   =========================================================
   TABLET ≤ 900px
   =========================================================
   ========================================================= */

@media (max-width: 900px) {


    /* -----------------------------------------
       BUTTON POSITION
    ----------------------------------------- */

    .manager-mode-button {

        left: 20px;

        top: 40px;
    }


    .director-mode-button {

        right: 20px;

        top: 40px;
    }


    /* -----------------------------------------
       POPUP MANAGER
    ----------------------------------------- */

    .manager-popup-container {

        width: 100vw;

        height: 100vh;

        max-width: none;

        border-radius: 0;

        border: 0;
    }


    .manager-popup-header {

        height: 44px;

        padding:
            0 12px;
    }


    .manager-popup-title {

        font-size: 11px;

        gap: 8px;
    }


    .manager-popup-status {

        width: 7px;
        height: 7px;
    }


    .manager-popup-close {

        width: 32px;
        height: 32px;

        font-size: 20px;
    }


    #managerFrame {

        height:
            calc(100% - 44px);
    }


    /* -----------------------------------------
       DIRECTOR KPI
    ----------------------------------------- */

    .director-kpi-grid {

        grid-template-columns:
            repeat(2,1fr);
    }


    /* -----------------------------------------
       DIRECTOR ACTIONS
    ----------------------------------------- */

    .director-actions {

        grid-template-columns:
            repeat(2,1fr);
    }

}


/* =========================================================
   =========================================================
   MOBILE ≤ 600px
   =========================================================
   ========================================================= */

@media (max-width: 600px) {


    /* =====================================================
       BUTTONS
       MANAGER LEFT
       DIRECTOR RIGHT
    ===================================================== */

    .manager-mode-button,
    .director-mode-button {

        top: 40px;

        padding:
            5px 10px 5px 5px;

        gap: 7px;

        max-width:
            calc(50vw - 18px);

        box-shadow:
            0 8px 25px
            rgba(0,0,0,.55);

        transform: none;
    }


    .manager-mode-button {

        left: 10px;

        right: auto;
    }


    .director-mode-button {

        right: 10px;

        left: auto;
    }


    /* -----------------------------------------
       HOVER
    ----------------------------------------- */

    .manager-mode-button:hover,
    .director-mode-button:hover {

        transform:
            translateY(-3px)
            scale(1.02);
    }


    /* -----------------------------------------
       AVATAR
    ----------------------------------------- */

    .manager-avatar,
    .director-avatar {

        width: 42px;
        height: 42px;

        border-width:
            1.5px;
    }


    .manager-avatar span,
    .director-avatar span {

        font-size: 20px;
    }


    /* -----------------------------------------
       LABEL
    ----------------------------------------- */

    .manager-label strong,
    .director-label strong {

        font-size: 10px;

        letter-spacing: .7px;
    }


    .manager-label small,
    .director-label small {

        font-size: 8px;

        margin-top: 3px;
    }


    /* =====================================================
       MANAGER POPUP
    ===================================================== */

    .manager-popup-container {

        width: 100vw;

        height: 100vh;

        max-width: none;

        border-radius: 0;
    }


    .manager-popup-header {

        height: 42px;
    }


    #managerFrame {

        height:
            calc(100% - 42px);
    }


    /* =====================================================
       DIRECTOR OVERLAY
    ===================================================== */

    .director-overlay {

        padding: 10px;

        align-items:
            flex-end;
    }


    /* -----------------------------------------
       PANEL
    ----------------------------------------- */

    .director-panel {

        width: 100%;

        max-width: 100%;

        max-height:
            calc(100vh - 20px);

        border-radius:
            18px 18px 12px 12px;

        margin: 0;
    }


    /* -----------------------------------------
       HEADER
    ----------------------------------------- */

    .director-header {

        padding:
            16px;

        gap: 10px;

        position:
            sticky;

        top: 0;

        z-index: 5;

        background:
            rgba(17,17,17,.96);

        backdrop-filter:
            blur(12px);
    }


    .director-title {

        font-size: 15px;

        letter-spacing: 1px;
    }


    .director-subtitle {

        font-size: 10px;
    }


    .director-close {

        width: 36px;
        height: 36px;

        min-width: 36px;

        font-size: 21px;
    }


    /* -----------------------------------------
       KPI
    ----------------------------------------- */

    .director-kpi-grid {

        grid-template-columns:
            repeat(2,1fr);

        gap: 8px;

        padding:
            14px 16px;
    }


    .director-kpi {

        padding:
            14px 12px;

        border-radius:
            12px;
    }


    .director-kpi span {

        font-size: 8px;

        letter-spacing: .7px;

        margin-top: 6px;
    }


    .director-kpi strong {

        font-size: 17px;
    }


    /* -----------------------------------------
       SUMMARY
    ----------------------------------------- */

    .director-summary {

        margin:
            0 16px 16px;

        padding:
            14px;

        gap:
            12px;

        border-radius:
            14px;
    }


    .summary-avatar {

        width: 62px;

        height: 62px;

        border-radius: 13px;
    }


    .summary-content h3 {

        font-size: 14px;

        margin:
            0 0 5px;
    }


    .summary-content p {

        font-size: 11px;

        line-height: 1.5;

        margin:
            3px 0;
    }


    /* -----------------------------------------
       SECTION
    ----------------------------------------- */

    .director-section {

        padding:
            0 16px 17px;
    }


    .director-section-title {

        font-size: 9px;

        letter-spacing: 1.2px;

        margin-top: 10px;
    }


    /* -----------------------------------------
       PRIORITY
    ----------------------------------------- */

    .director-priority-grid {

        grid-template-columns:
            1fr;

        gap: 7px;
    }


    .priority-item {

        gap: 10px;

        padding: 11px;

        border-radius: 11px;
    }


    .priority-icon {

        width: 34px;
        height: 34px;

        min-width: 34px;

        font-size: 16px;
    }


    .priority-item strong {

        font-size: 11px;
    }


    .priority-item small {

        font-size: 9px;
    }


    /* -----------------------------------------
       ACTIONS
    ----------------------------------------- */

    .director-actions {

        grid-template-columns:
            repeat(2,1fr);

        gap: 7px;
    }


    .director-action {

        min-height:
            68px;

        padding:
            12px 8px;

        gap:
            5px;

        border-radius:
            11px;

        font-size:
            10px;
    }


    /* -----------------------------------------
       FOOTER
    ----------------------------------------- */

    .director-footer {

        padding:
            12px 16px;

        font-size:
            8px;

        flex-wrap:
            wrap;
    }

}


/* =========================================================
   =========================================================
   VERY SMALL PHONE ≤ 380px
   =========================================================
   ========================================================= */

@media (max-width: 380px) {


    /* -----------------------------------------
       BUTTONS
    ----------------------------------------- */

    .manager-mode-button,
    .director-mode-button {

        top: 15px;

        padding:
            4px 8px 4px 4px;

        gap: 5px;

        max-width:
            calc(50vw - 12px);
    }


    .manager-mode-button {

        left: 6px;
    }


    .director-mode-button {

        right: 6px;
    }


    /* -----------------------------------------
       AVATAR
    ----------------------------------------- */

    .manager-avatar,
    .director-avatar {

        width: 38px;
        height: 38px;
    }


    /* -----------------------------------------
       LABEL
    ----------------------------------------- */

    .manager-label strong,
    .director-label strong {

        font-size: 9px;
    }


    .manager-label small,
    .director-label small {

        display: none;
    }


    /* -----------------------------------------
       DIRECTOR PANEL
    ----------------------------------------- */

    .director-overlay {

        padding: 6px;
    }


    .director-panel {

        max-height:
            calc(100vh - 12px);

        border-radius:
            16px 16px 10px 10px;
    }


    .director-kpi-grid {

        padding:
            10px;

        gap:
            6px;
    }


    .director-kpi {

        padding:
            11px 9px;
    }


    .director-kpi strong {

        font-size:
            15px;
    }


    .director-summary {

        margin:
            0 10px 12px;
    }


    .director-section {

        padding:
            0 10px 14px;
    }


    .director-actions {

        gap:
            6px;
    }


    .director-action {

        min-height:
            62px;

        font-size:
            9px;
    }

}


/* =========================================================
   =========================================================
   LANDSCAPE MOBILE
   =========================================================
   ========================================================= */

@media
(max-width: 900px)
and (orientation: landscape) {


    /* -----------------------------------------
       BUTTONS
    ----------------------------------------- */

    .manager-mode-button,
    .director-mode-button {

        top: 15px;
    }


    .manager-mode-button {

        left: 20px;
    }


    .director-mode-button {

        right: 20px;
    }


    /* -----------------------------------------
       DIRECTOR OVERLAY
    ----------------------------------------- */

    .director-overlay {

        align-items:
            center;

        padding:
            8px;
    }


    .director-panel {

        max-height:
            96vh;

        width:
            94vw;
    }


    .director-kpi-grid {

        grid-template-columns:
            repeat(4,1fr);
    }


    .director-priority-grid {

        grid-template-columns:
            repeat(2,1fr);
    }


    .director-actions {

        grid-template-columns:
            repeat(4,1fr);
    }

}


/* =========================================================
   =========================================================
   TOUCH DEVICE
   =========================================================
   ========================================================= */

@media (hover: none) {


    .manager-mode-button:hover,
    .director-mode-button:hover,
    .priority-item:hover,
    .director-action:hover {

        transform:
            none;
    }


    .manager-mode-button,
    .director-mode-button {

        -webkit-tap-highlight-color:
            transparent;
    }

}


/* =========================================================
   =========================================================
   SAFE AREA - iPHONE
   =========================================================
   ========================================================= */

@supports
(padding: env(safe-area-inset-top)) {


    .manager-mode-button {

        top:
            calc(
                40px +
                env(safe-area-inset-top)
            );
    }


    .director-mode-button {

        top:
            calc(
                40px +
                env(safe-area-inset-top)
            );
    }


    @media (max-width: 600px) {

        .manager-mode-button,
        .director-mode-button {

            top:
                calc(
                    40px +
                    env(safe-area-inset-top)
                );
        }

    }

}
