/* assets/css/style.css - Sistem Informasi Bendahara Kampung */

:root {
    --primary-color: #0f766e;
    --primary-hover: #115e59;
    --primary-subtle: #ccfbf1;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --card-border: #e2e8f0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-custom {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    box-shadow: 0 4px 20px -2px rgba(15, 118, 110, 0.25);
    padding: 0.85rem 1rem;
}

/* Custom Donggel (Hamburger Toggle Button) Cantik Modern */
.custom-donggel {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    padding: 6px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none !important;
}

.custom-donggel:hover, .custom-donggel:focus, .custom-donggel:active {
    background: rgba(255, 255, 255, 0.28) !important;
    border-color: #5eead4 !important;
    box-shadow: 0 0 15px rgba(94, 234, 212, 0.45) !important;
    transform: translateY(-1px);
}

.donggel-box {
    width: 18px;
    height: 13px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.donggel-line {
    display: block;
    height: 2px;
    width: 100%;
    background: #ffffff;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.custom-donggel:hover .donggel-line:nth-child(2) {
    width: 70%;
    background-color: #5eead4;
}

.donggel-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffffff;
}

/* Offcanvas Drawer Style di Layar HP */
@media (max-width: 991.98px) {
    .offcanvas-custom {
        background: linear-gradient(180deg, #0d3b37 0%, #092623 100%) !important;
        color: #ffffff !important;
        border-left: 1px solid rgba(94, 234, 212, 0.25) !important;
        box-shadow: -10px 0 35px rgba(0, 0, 0, 0.55) !important;
        max-width: 320px;
    }

    .offcanvas-custom .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.98rem !important;
        margin-bottom: 0.35rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        align-items: center;
        transition: all 0.2s ease;
    }

    .offcanvas-custom .nav-link:hover {
        background: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
        transform: translateX(4px);
    }

    .offcanvas-custom .nav-link.active {
        background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%) !important;
        color: #ffffff !important;
        font-weight: 700;
        border: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 4px 15px rgba(20, 184, 166, 0.35);
    }

    .offcanvas-custom .nav-link i {
        width: 24px;
        font-size: 1.1rem;
        color: #5eead4;
    }

    .offcanvas-custom .nav-link.active i {
        color: #ffffff;
    }
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
}

.navbar-brand i {
    color: #5eead4;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85) !important;
}

.nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.22);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Cards & Containers */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Card Pos Kas Multi-Warna */
.card-pos-custom {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-pos-custom:hover {
    transform: translateY(-4px);
}

.card-pos-emerald:hover {
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.18) !important;
}

.card-pos-blue:hover {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18) !important;
}

.card-pos-amber:hover {
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.18) !important;
}

.card-pos-purple:hover {
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.18) !important;
}

.card-pos-rose:hover {
    box-shadow: 0 12px 28px rgba(225, 29, 72, 0.18) !important;
}

.card-pos-orange:hover {
    box-shadow: 0 12px 28px rgba(234, 88, 12, 0.18) !important;
}

.card-pos-cyan:hover {
    box-shadow: 0 12px 28px rgba(8, 145, 178, 0.18) !important;
}

.card-pos-indigo:hover {
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.18) !important;
}

.hover-teal:hover {
    color: var(--primary-color) !important;
}

.hover-primary:hover {
    color: #2563eb !important;
}

.card-kpi {
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
    height: 100%;
    min-height: 135px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-kpi:hover {
    transform: translateY(-3px);
}

.card-kpi.bg-primary-kpi {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}
.card-kpi.bg-success-kpi {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.card-kpi.bg-danger-kpi {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}
.card-kpi.bg-purple-kpi {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.card-kpi .icon-kpi {
    position: absolute;
    right: 15px;
    bottom: 12px;
    font-size: 3.5rem;
    opacity: 0.18;
}

.card-kpi .label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-kpi .value {
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Badge & Pills */
.badge-subtle-success {
    background-color: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

.badge-subtle-danger {
    background-color: #ffe4e6;
    color: #9f1239;
    font-weight: 600;
}

.badge-subtle-primary {
    background-color: #ccfbf1;
    color: #115e59;
    font-weight: 600;
}

.badge-subtle-warning {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

/* Table */
.table-custom thead th {
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.85rem 0.75rem;
}

.table-custom tbody td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    font-size: 0.92rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn-primary-teal {
    background-color: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary-teal:hover {
    background-color: #115e59;
    border-color: #115e59;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.btn-sm-rounded {
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
}

/* Progress bar inside cards */
.progress-thin {
    height: 7px;
    border-radius: 5px;
    background-color: #e2e8f0;
}

/* Modal styling */
.modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 10px 35px rgba(0,0,0,0.15);
}

.modal-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

/* Kuitansi Print Design */
.kuitansi-box {
    border: 2px dashed #94a3b8;
    background: #ffffff;
    border-radius: 12px;
    padding: 2.2rem;
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.kuitansi-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 5rem;
    font-weight: 900;
    color: rgba(15, 118, 110, 0.05);
    letter-spacing: 0.1em;
    pointer-events: none;
    user-select: none;
}

/* Print Only Styles */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .no-print, .navbar, footer, .btn, .breadcrumb, .app-sidebar, .sidebar-overlay, .app-topbar {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .print-only {
        display: block !important;
    }
    .card-custom {
        border: none !important;
        box-shadow: none !important;
    }
    .kuitansi-box {
        border: 2px solid #000000 !important;
        box-shadow: none !important;
        padding: 1.5rem !important;
        max-width: 100% !important;
    }
    .table-custom thead th {
        background-color: #e2e8f0 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================== */
/* SIDEBAR NAVIGATION LAYOUT (MENU DI SAMPING)                     */
/* ============================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #092623 0%, #0d3b37 50%, #071f1d 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.18);
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: #ffffff;
    color: #0f766e;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user {
    padding: 0.85rem 1.15rem;
    margin: 0.85rem 0.85rem 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.85rem 1.25rem 0.35rem 1.25rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0 0.75rem;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.32);
}

.sidebar-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    color: #5eead4;
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
    flex-grow: 1;
    min-width: 0;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--light-bg);
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* Desktop Collapse Mode */
.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

.sidebar-collapsed .app-main {
    margin-left: 0 !important;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

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

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1025;
        display: none;
        backdrop-filter: blur(2px);
    }

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

/* Responsif Tambahan di HP (Smartphone) */
@media (max-width: 576px) {
    .navbar-custom {
        padding: 0.65rem 0.85rem;
    }
    .navbar-brand span {
        font-size: 1rem;
    }
    .navbar-brand small {
        font-size: 0.68rem !important;
    }
    .card-kpi .value {
        font-size: 1.35rem;
    }
    .card-kpi {
        padding: 1rem;
    }
    .card-custom {
        border-radius: 12px;
    }
    .table-custom tbody td, .table-custom thead th {
        padding: 0.65rem 0.5rem;
        font-size: 0.82rem;
    }
}

/* Styling Iuran Ceklis Cepat & 1-Click Bayar */
.btn-toggle-lunas {
    transition: all 0.25s ease;
    font-size: 0.78rem;
}
.btn-toggle-lunas:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    transform: scale(1.04);
}
.btn-bayar-cepat {
    transition: all 0.2s ease;
}
.btn-bayar-cepat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}
.table-row-lunas {
    background-color: #f0fdf4 !important;
}
.table-row-lunas td {
    background-color: transparent !important;
}

/* Styling Rekap 1 Tahun (12 Bulan) Matriks Iuran */
.matrix-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    max-width: 320px;
}
@media (min-width: 992px) {
    .matrix-container {
        grid-template-columns: repeat(12, 1fr);
        max-width: 440px;
    }
}
.matrix-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 2px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
    user-select: none;
    line-height: 1.1;
    display: inline-block;
}
.matrix-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}
.matrix-pill-lunas {
    background-color: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.matrix-pill-current {
    background-color: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
    animation: pulse-border 2s infinite;
}
.matrix-pill-past-unpaid {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}
.matrix-pill-future {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Modal Popup 1 Tahun (Model Card Menyamping 3 x 4) */
.pop-month-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.pop-month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #0f766e;
}
.pop-month-card.is-selected {
    border-color: #0f766e !important;
    background-color: #f0fdfa !important;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.18) !important;
}
.pop-month-card.is-lunas {
    background-color: #f0fdf4 !important;
    border-color: #86efac !important;
    cursor: default;
}
.pop-month-card.is-current {
    border-top: 3.5px solid #f59e0b;
}
.pop-month-card.is-past-unpaid {
    border-top: 3.5px solid #ef4444;
}
.pop-month-card.is-future {
    border-top: 3.5px solid #3b82f6;
    background-color: #fafbfc;
}
.pop-pos-item {
    font-size: 0.78rem;
    padding: 2px 0;
    border-top: 1px dashed #e2e8f0;
}
.btn-quick-sel {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.15s ease;
}
