/* =========================================================
   KAS DAWIS 4
   Global Design System
========================================================= */

:root {
    --sidebar-width: 260px;

    --primary: #198754;
    --primary-dark: #146c43;
    --primary-soft: #e8f5ee;

    --danger: #dc3545;
    --warning: #f59e0b;

    --sidebar-bg: #12372a;
    --sidebar-hover: rgba(255,255,255,.08);

    --body-bg: #f5f7f9;
    --card-bg: #ffffff;

    --text-dark: #263238;
    --text-muted: #6c757d;

    --border-color: #e7eaed;

    --radius: 14px;

    --shadow:
        0 3px 14px rgba(0,0,0,.05);
}


/* =========================================================
   GLOBAL
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--body-bg);
    color: var(--text-dark);
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    text-decoration: none;
}


/* =========================================================
   WRAPPER
========================================================= */

.app-wrapper {
    min-height: 100vh;
}


/* =========================================================
   SIDEBAR
========================================================= */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    background: var(--sidebar-bg);

    color: white;

    z-index: 1040;

    overflow-y: auto;

    transition: transform .25s ease;
}


.sidebar-brand {
    min-height: 78px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 15px 20px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}


.brand-icon {
    width: 44px;
    height: 44px;

    border-radius: 12px;

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

    background: rgba(255,255,255,.12);

    font-size: 22px;
}


.brand-title {
    font-size: 17px;
    font-weight: 700;
}


.brand-subtitle {
    font-size: 11px;
    opacity: .65;
}


.sidebar-menu {
    padding: 18px 12px;
}


.menu-label {
    color: rgba(255,255,255,.45);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;

    padding: 0 12px 8px;
}


.sidebar-link {
    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    padding: 10px 13px;

    margin-bottom: 4px;

    color: rgba(255,255,255,.78);

    border-radius: 10px;

    transition: .2s ease;
}


.sidebar-link i {
    width: 22px;

    text-align: center;

    font-size: 17px;
}


.sidebar-link:hover {
    color: white;
    background: var(--sidebar-hover);
}


.sidebar-link.active {
    color: #12372a;
    background: white;
    font-weight: 600;
}


/* =========================================================
   NAVBAR
========================================================= */

.app-navbar {
    position: fixed;

    top: 0;
    right: 0;
    left: var(--sidebar-width);

    height: 68px;

    background: white;

    border-bottom:
        1px solid var(--border-color);

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

    padding: 0 25px;

    z-index: 1030;
}


.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
}


.navbar-page-title {
    font-size: 18px;
    font-weight: 700;
}


.sidebar-toggle {
    display: none;

    border: 0;
    background: transparent;

    font-size: 27px;

    margin-right: 12px;

    padding: 0;
}


.admin-profile {
    display: flex;
    align-items: center;

    gap: 10px;
}


.admin-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

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

    color: white;

    background: var(--primary);
}


.admin-info {
    display: flex;
    flex-direction: column;
}


.admin-name {
    font-size: 13px;
    font-weight: 600;
}


.admin-info small {
    color: var(--text-muted);
    font-size: 11px;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.app-main {
    margin-left: var(--sidebar-width);

    padding-top: 68px;

    min-height: 100vh;
}


.app-content {
    padding: 25px;
}


/* =========================================================
   CARDS
========================================================= */

.app-card {
    background: var(--card-bg);

    border: 1px solid var(--border-color);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    padding: 20px;
}


.stat-card {
    height: 100%;
}


.stat-label {
    color: var(--text-muted);

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;
}


.stat-value {
    margin-top: 7px;

    font-size: 24px;
    font-weight: 700;
}


.stat-icon {
    width: 46px;
    height: 46px;

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

    border-radius: 12px;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 21px;
}


/* =========================================================
   TABLE
========================================================= */

.app-table {
    margin-bottom: 0;
}


.app-table thead th {
    background: #f8f9fa;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 700;

    border-bottom:
        1px solid var(--border-color);

    white-space: nowrap;
}


.app-table td {
    vertical-align: middle;

    font-size: 13px;
}


/* =========================================================
   FOOTER
========================================================= */

.app-footer {
    min-height: 58px;

    margin: 10px 25px 0;

    border-top:
        1px solid var(--border-color);

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

    color: var(--text-muted);

    font-size: 12px;
}


.footer-version {
    font-size: 11px;
}


/* =========================================================
   MOBILE
========================================================= */

.sidebar-overlay {
    display: none;
}


@media (max-width: 991.98px) {

    .app-sidebar {
        transform: translateX(-100%);
    }


    .app-sidebar.show {
        transform: translateX(0);
    }


    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(0,0,0,.45);

        z-index: 1035;
    }


    .sidebar-overlay.show {
        display: block;
    }


    .app-navbar {
        left: 0;

        padding: 0 16px;
    }


    .sidebar-toggle {
        display: block;
    }


    .app-main {
        margin-left: 0;
    }


    .app-content {
        padding: 18px 14px;
    }


    .app-footer {
        margin-left: 14px;
        margin-right: 14px;
    }


    .admin-info {
        display: none;
    }

}


@media (max-width: 575.98px) {

    .navbar-page-title {
        font-size: 16px;
    }


    .stat-value {
        font-size: 20px;
    }


    .app-card {
        padding: 16px;
    }

}

/* =========================================================
   LOGIN
========================================================= */

.login-page {
    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #0d3b2e 0%,
            #198754 100%
        );
}


.login-wrapper {
    min-height: 100vh;

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

    padding: 20px;
}


.login-card {
    width: 100%;
    max-width: 420px;

    background: white;

    border-radius: 20px;

    padding: 35px;

    box-shadow:
        0 20px 60px
        rgba(0,0,0,.18);
}


.login-logo {
    width: 70px;
    height: 70px;

    margin: 0 auto 18px;

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

    border-radius: 18px;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 32px;
}


.login-card .form-control,
.login-card .input-group-text {
    min-height: 48px;
}


.login-button {
    min-height: 48px;

    font-weight: 600;

    border-radius: 10px;
}


.login-footer {
    margin-top: 25px;

    padding-top: 20px;

    border-top:
        1px solid var(--border-color);

    text-align: center;

    color: var(--text-muted);

    font-size: 12px;
}


@media (max-width: 575.98px) {

    .login-card {
        padding: 28px 22px;
    }

}

/* =========================================================
   USER DROPDOWN
========================================================= */

.user-menu {
    position: relative;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;

    border: 0;
    background: transparent;

    padding: 5px;

    cursor: pointer;
}

.admin-profile:focus {
    outline: none;
}

.user-chevron {
    font-size: 12px;
    color: var(--text-muted);

    transition: transform .2s ease;
}

.user-menu.open .user-chevron {
    transform: rotate(180deg);
}


/* DROPDOWN */

.user-dropdown {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    width: 220px;

    padding: 8px;

    background: #ffffff;

    border: 1px solid var(--border-color);
    border-radius: 12px;

    box-shadow:
        0 10px 35px rgba(0,0,0,.12);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility .18s;

    z-index: 2000;
}


.user-dropdown.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


.user-dropdown-header {
    display: flex;
    flex-direction: column;

    padding: 9px 11px;
}


.user-dropdown-header strong {
    font-size: 13px;
}


.user-dropdown-header small {
    color: var(--text-muted);
    font-size: 11px;
}


.user-dropdown-divider {
    height: 1px;

    margin: 5px 0;

    background: var(--border-color);
}


.user-dropdown-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 11px;

    border-radius: 8px;

    color: var(--text-dark);

    font-size: 13px;
}


.user-dropdown-item:hover {
    background: #f5f7f9;
    color: var(--text-dark);
}


.user-dropdown-item.logout {
    color: #dc3545;
}


.user-dropdown-item.logout:hover {
    background: #fff1f2;
    color: #dc3545;
}


@media (max-width: 575.98px) {

    .user-chevron {
        display: none;
    }

    .user-dropdown {
        right: 0;
        width: 210px;
    }

}

/* =========================================================
   USER PROFILE & DROPDOWN - FINAL
========================================================= */

.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.user-menu {
    position: relative;
}


/* PROFILE BUTTON */

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 4px 6px;

    border: 0;
    outline: 0;

    background: transparent;

    cursor: pointer;

    font-family: inherit;
}


.admin-profile:focus,
.admin-profile:active {
    border: 0;
    outline: 0;
    box-shadow: none;
}


.admin-avatar {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

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

    border-radius: 50%;

    background: var(--primary);
    color: #ffffff;

    font-size: 18px;
}


.admin-info {
    display: flex;
    flex-direction: column;

    text-align: left;

    line-height: 1.25;
}


.admin-name {
    color: var(--text-dark);

    font-size: 13px;
    font-weight: 700;
}


.admin-info small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 11px;
}


.user-chevron {
    margin-left: 2px;

    color: var(--text-muted);

    font-size: 11px;

    transition: transform .2s ease;
}


.user-menu.open .user-chevron {
    transform: rotate(180deg);
}


/* =========================================================
   DROPDOWN BOX
========================================================= */

.user-dropdown {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 230px;

    padding: 8px;

    background: #ffffff;

    border:
        1px solid var(--border-color);

    border-radius: 14px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, .14);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    pointer-events: none;

    transition:
        opacity .18s ease,
        transform .18s ease,
        visibility .18s ease;

    z-index: 9999;
}


/* DROPDOWN OPEN */

.user-dropdown.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
}


/* =========================================================
   DROPDOWN HEADER
========================================================= */

.user-dropdown-header {
    display: flex;
    flex-direction: column;

    padding: 10px 12px;
}


.user-dropdown-header strong {
    display: block;

    color: var(--text-dark);

    font-size: 14px;
    font-weight: 700;

    line-height: 1.3;
}


.user-dropdown-header small {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 12px;
}


/* DIVIDER */

.user-dropdown-divider {
    height: 1px;

    margin: 5px 4px;

    background: var(--border-color);
}


/* =========================================================
   DROPDOWN MENU ITEM
========================================================= */

.user-dropdown-item {
    display: flex;
    align-items: center;

    width: 100%;

    gap: 10px;

    padding: 10px 12px;

    border-radius: 9px;

    color: var(--text-dark);

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

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


.user-dropdown-item i {
    width: 18px;

    flex: 0 0 18px;

    text-align: center;

    font-size: 16px;
}


.user-dropdown-item:hover {
    color: var(--text-dark);

    background: #f4f6f8;
}


/* LOGOUT */

.user-dropdown-item.logout {
    color: #dc3545;
}


.user-dropdown-item.logout:hover {
    color: #dc3545;

    background: #fff1f2;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 991.98px) {

    .admin-info {
        display: none;
    }

    .user-chevron {
        display: none;
    }

    .admin-profile {
        padding: 0;
    }

    .admin-avatar {
        width: 42px;
        height: 42px;

        flex-basis: 42px;
    }

    .user-dropdown {
        top: calc(100% + 12px);
        right: 0;

        width: 220px;
    }

}

/* =========================================================
   PORTAL WARGA
========================================================= */

.warga-page {
    min-height: 100vh;
    background: #f5f7f8;
}

.warga-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e8ecef;
}

/* =========================================================
   PORTAL WARGA - LAYOUT
========================================================= */

.warga-navbar-inner {
    width: 100%;
    max-width: 1180px;

    margin: 0 auto;
    padding: 14px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* =========================================================
   PORTAL WARGA - BRAND
========================================================= */

.warga-brand {
    display: flex;
    align-items: center;

    gap: 12px;
}

.warga-brand-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

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

    border-radius: 13px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 22px;
}

.warga-brand-title {
    color: var(--text-dark);

    font-size: 16px;
    font-weight: 700;

    line-height: 1.2;
}

.warga-brand-subtitle {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   PORTAL WARGA - LOGOUT
========================================================= */

.warga-logout {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

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

    border-radius: 50%;

    background: #f1f4f3;

    color: var(--primary);

    font-size: 19px;

    transition: .2s ease;
}

.warga-logout:hover {
    background: #fff0f1;
    color: var(--danger);
}


/* =========================================================
   PORTAL WARGA - MAIN
========================================================= */

.warga-main {
    padding: 30px 0;
}

.warga-main > .container {
    max-width: 1180px;
}


/* =========================================================
   PORTAL WARGA - WELCOME
========================================================= */

.warga-welcome {
    margin-bottom: 20px;
}

.warga-welcome-label {
    margin-bottom: 6px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1px;
}

.warga-welcome h1 {
    margin: 0;

    color: var(--text-dark);

    font-size: 28px;
    font-weight: 750;

    line-height: 1.25;
}

.warga-welcome p {
    margin: 7px 0 0;

    color: var(--text-muted);

    font-size: 14px;
}


/* =========================================================
   PORTAL WARGA - INFO
========================================================= */

.warga-info {
    width: 100%;

    margin-bottom: 24px;
    padding: 14px 16px;

    display: flex;
    align-items: flex-start;

    gap: 11px;

    background: #eaf6f0;

    border: 1px solid #d5ebe0;
    border-radius: 12px;

    color: #35624e;

    font-size: 13px;
    line-height: 1.55;
}

.warga-info > i {
    flex: 0 0 auto;

    margin-top: 1px;

    color: var(--primary);

    font-size: 16px;
}


/* =========================================================
   PORTAL WARGA - STAT CARDS
========================================================= */

.warga-stat-card {
    width: 100%;
    min-height: 125px;

    padding: 20px;

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

    gap: 15px;

    background: #ffffff;

    border: 1px solid var(--border-color);
    border-radius: 16px;

    box-shadow: var(--shadow);
}

.warga-stat-label {
    margin-bottom: 7px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .4px;
}

.warga-stat-value {
    color: var(--text-dark);

    font-size: 24px;
    font-weight: 750;

    line-height: 1.2;
}

.warga-stat-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

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

    border-radius: 13px;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 22px;
}


/* =========================================================
   PORTAL WARGA - RIWAYAT CARD
========================================================= */

.warga-card {
    width: 100%;

    padding: 22px;

    background: #ffffff;

    border: 1px solid var(--border-color);
    border-radius: 16px;

    box-shadow: var(--shadow);
}

.warga-card-header {
    margin-bottom: 18px;

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

    gap: 15px;
}

.warga-card-header h5 {
    margin: 0;

    color: var(--text-dark);

    font-size: 17px;
    font-weight: 700;
}

.warga-card-header p {
    margin: 4px 0 0;

    color: var(--text-muted);

    font-size: 12px;
}

.warga-card-header > i {
    color: var(--primary);

    font-size: 22px;
}


/* =========================================================
   PORTAL WARGA - TABLE
========================================================= */

.warga-table {
    width: 100%;

    margin-bottom: 0;
}

.warga-table thead th {
    padding: 13px 12px;

    background: #f7f9f8;

    border-bottom:
        1px solid var(--border-color);

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}

.warga-table tbody td {
    padding: 14px 12px;

    border-color: var(--border-color);

    color: var(--text-dark);

    font-size: 13px;

    vertical-align: middle;
}


/* =========================================================
   PORTAL WARGA - FOOTER
========================================================= */

.warga-footer {
    margin-top: 30px;
    padding: 18px 2px 5px;

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

    gap: 10px;

    border-top:
        1px solid var(--border-color);

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   PORTAL WARGA - MOBILE
========================================================= */

@media (max-width: 767.98px) {

    .warga-navbar-inner {
        padding: 12px 16px;
    }

    .warga-brand-icon {
        width: 42px;
        height: 42px;

        flex-basis: 42px;

        font-size: 20px;
    }

    .warga-brand-title {
        font-size: 15px;
    }

    .warga-logout {
        width: 42px;
        height: 42px;

        flex-basis: 42px;
    }

    .warga-main {
        padding: 22px 0;
    }

    .warga-main > .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .warga-welcome {
        margin-bottom: 18px;
    }

    .warga-welcome h1 {
        font-size: 25px;
    }

    .warga-welcome p {
        font-size: 13px;
    }

    .warga-info {
        margin-bottom: 20px;

        padding: 13px 14px;

        font-size: 12px;
    }

    .warga-stat-card {
        min-height: 105px;

        padding: 17px 18px;

        border-radius: 15px;
    }

    .warga-stat-value {
        font-size: 21px;
    }

    .warga-stat-icon {
        width: 45px;
        height: 45px;

        flex-basis: 45px;

        font-size: 20px;
    }

    .warga-card {
        padding: 17px;

        border-radius: 15px;
    }

    .warga-card-header {
        margin-bottom: 15px;
    }

    .warga-table {
        min-width: 600px;
    }

    .warga-footer {
        flex-direction: column;

        justify-content: center;

        text-align: center;
    }
}

/* =========================================================
   DYNAMIC SIDEBAR BRAND - FINAL
========================================================= */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-box {
    width: 48px;
    height: 48px;

    min-width: 48px;
    max-width: 48px;

    flex: 0 0 48px;

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

    overflow: hidden;

    border-radius: 12px;

    background: rgba(255,255,255,.12);
}

.sidebar-logo-box .sidebar-logo-img {
    display: block !important;

    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;
    max-width: 42px !important;

    object-fit: contain !important;

    margin: 0 !important;
    padding: 2px !important;

    position: static !important;
}

.sidebar-brand-info {
    flex: 1;
    min-width: 0;
}

.sidebar-brand-info .brand-title {
    margin: 0;

    color: #ffffff;

    font-size: 16px;
    font-weight: 700;

    line-height: 1.25;

    white-space: normal;
    overflow-wrap: break-word;
}

.sidebar-brand-info .brand-subtitle {
    margin-top: 3px;

    color: rgba(255,255,255,.65);

    font-size: 11px;

    line-height: 1.3;
}

