/* admin.css — admin-only styles, extends app.css */

/* ── ADMIN LAYOUT OVERRIDES ───────────────────────────────────── */
.admin-sidebar {
    width: 260px;
    min-width:260px;
}





/* ── TOPBAR ───────────────────────────────────────────────────── */
.admin-topbar-user {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--gray-100);
}

/* ── STAT CARDS ───────────────────────────────────────────────── */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    opacity: 0.08;
    color: var(--black);
}

/* ── TABLE ACTIONS ────────────────────────────────────────────── */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tbl-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 16px;
}

.tbl-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tbl-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tbl-cell-name  { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.tbl-cell-meta  { font-size: 12px; color: var(--gray-400); }

/* ── MODALS ───────────────────────────────────────────────────── */
/* Base styles already in app.css, these are admin-specific additions */

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.modal-icon-green  { background: var(--green-light);  color: var(--green); }
.modal-icon-amber  { background: var(--amber-light);  color: var(--amber); }
.modal-icon-red    { background: var(--red-light);    color: var(--red);   }
.modal-icon-dark   { background: var(--gray-100);     color: var(--gray-800); }

/* Form fields inside modals */
.modal-body .admin-form-group { margin-bottom: 16px; }
.modal-body .admin-form-group:last-child { margin-bottom: 0; }

/* Image preview inside modal */
.img-preview-wrap {
    position: relative;
    display: inline-block;
}

.img-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: var(--red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    border: 2px solid var(--white);
}

/* Delete confirm modal */
.delete-confirm-body {
    text-align: center;
    padding: 8px 0 4px;
}

.delete-confirm-icon {
    width: 56px;
    height: 56px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.delete-confirm-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.delete-confirm-desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ── STATUS SELECTOR (transactions) ─────────────────────────── */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 28px 6px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c5c58' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
    transition: opacity var(--transition);
}

.status-select:disabled { opacity: 0.5; cursor: not-allowed; }
.status-select.pending   { background-color: var(--amber-light); color: var(--amber); }
.status-select.completed { background-color: var(--green-light); color: var(--green); }
.status-select.failed    { background-color: var(--red-light);   color: var(--red);   }

/* ── TRANSACTION DETAIL in modal ────────────────────────────── */
.trx-detail-section {
    margin-bottom: 20px;
}

.trx-detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.trx-detail-value {
    font-size: 14px;
    color: var(--black);
    line-height: 1.5;
}

.trx-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.trx-item-row:last-child { border-bottom: none; }

.trx-item-name   { font-weight: 600; }
.trx-item-qty    { color: var(--gray-400); font-size: 12px; margin-top: 2px; }
.trx-item-price  { font-weight: 700; font-family: 'Fraunces', serif; font-size: 15px; }

.trx-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    font-weight: 700;
    font-size: 14px;
}

.trx-total-amount {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    color: var(--green);
}

/* ── SEARCH + FILTER BAR ─────────────────────────────────────── */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--black);
    outline: none;
    transition: border-color var(--transition);
    background: var(--white);
}

.search-input:focus { border-color: var(--black); }

.filter-select {
    padding: 9px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--black);
    background: var(--white);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--black); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 300;
        transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    }
    .admin-main    { margin-left: 0; }
    .admin-hamburger { display: flex; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-content { padding: 16px; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .search-input-wrap { max-width: 100%; }
}

/* ── GALLERY MODAL ─────────────────────────────────────────── */
.gallery-card {
    transition: box-shadow 150ms, transform 150ms;
}
.gallery-card:active {
    cursor: grabbing;
}
.gallery-ghost {
    opacity: 0.35;
    background: var(--gray-200) !important;
}
#gallery-upload-area:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

/* ── PRODUCT ACTIVE TOGGLE ─────────────────────────────────── */
.btn-active {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid transparent;
}
.btn-active:hover {
    background: var(--green);
    color: white;
}
.btn-inactive {
    background: var(--gray-100);
    color: var(--gray-400);
    border: 1px solid transparent;
}
.btn-inactive:hover {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ── TOGGLE SWITCH (modal) ─────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-200);
    border-radius: 100px;
    flex-shrink: 0;
    transition: background 200ms;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 200ms;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-switch {
    background: var(--green);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* ── DASHBOARD CHARTS ──────────────────────────────────────── */
@media (max-width: 900px) {
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── ADMIN PAGINATION ──────────────────────────────────────── */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.admin-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
    padding: 0 10px;
}
.admin-pagination .page-btn:hover:not(.disabled):not(.active) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}
.admin-pagination .page-btn.active {
    background: var(--black);
    border-color: var(--black);
    color: white;
}
.admin-pagination .page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.admin-pagination .page-ellipsis {
    color: var(--gray-400);
    font-size: 13px;
    padding: 0 4px;
}

/* SIDEBAR */

.admin-wrapper{
    display:flex;
    min-height:100vh;
}

.admin-sidebar{
    width:260px;
    min-width:260px;
}

.sidebar-logo{
    margin-bottom:40px;
}

.sidebar-logo-text{
    font-size:30px;
    font-weight:700;
    color:#fff;
}

.sidebar-logo-sub{
    color:#9ca3af;
    font-size:13px;
    margin-top:5px;
}

.sidebar-nav{
    margin-top:20px;
}

.sidebar-section-label{
    font-size:12px;
    color:#6b7280;
    margin-bottom:15px;
    letter-spacing:1px;
}

.sidebar-link{
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px 16px;
    border-radius:14px;
    color:#d1d5db;
    text-decoration:none;
    margin-bottom:10px;
    transition:0.3s;
    font-size:15px;
}

.sidebar-link:hover{
    background:#1f2937;
    color:#fff;
}

.sidebar-link.active{
    background:#1a7a4a;
    color:#fff;
}

.sidebar-footer{
    margin-top:30px;
}

.admin-main{
    flex:1;
    background:#f3f4f6;
}

.admin-topbar{
    height:80px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 30px;
    border-bottom:1px solid #e5e7eb;
}

.admin-topbar-title{
    font-size:24px;
    font-weight:700;
}

.admin-topbar-user{
    font-size:14px;
    color:#374151;
}

.admin-content{
    padding:30px;
}


/* CHART */

/* FIX LAYOUT */

.admin-wrapper{
    display:flex;
    min-height:100vh;
}

.admin-main{
    flex:1;
    width:100%;
    overflow-x:hidden;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.table-card{
    background:#fff;
    border-radius:24px;
    overflow:hidden;
    box-shadow:0 4px 20px rgba(0,0,0,0.04);
}

.table-card-header{
    padding:24px;
    border-bottom:1px solid #f1f1f1;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    flex-wrap:wrap;
}

.table-card-title{
    font-size:20px;
    font-weight:700;
}

.stat-card{
    background:#fff;
    border-radius:24px;
    padding:24px;
    position:relative;
    overflow:hidden;
}

.stat-label{
    font-size:13px;
    color:#6b7280;
    margin-bottom:10px;
}

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

.stat-sub{
    margin-top:8px;
    font-size:13px;
    color:#9ca3af;
}

.green{
    color:#16a34a;
}

.amber{
    color:#d97706;
}


/* CHART FIX */

#kasChart{
    width:100% !important;
    height:400px !important;
}

.btn-success{
    background:#16a34a;
    color:#fff;
}

.btn-success:hover{
    background:#15803d;
}
/* REKAP */

.rekap-table{
    width:100%;
    border-collapse:collapse;
    min-width:1200px;
}

.rekap-table th{
    background:#111827;
    color:#fff;
    padding:14px;
    font-size:13px;
    text-align:center;
}

.rekap-table td{
    border-bottom:1px solid #f1f1f1;
    padding:14px;
    text-align:center;
}

.rekap-nama{
    min-width:240px;
    text-align:left !important;
    background:#fff;
    position:sticky;
    left:0;
    z-index:2;
}

.paid-box{
    width:34px;
    height:34px;
    border-radius:10px;
    background:#dcfce7;
    color:#16a34a;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:auto;
    font-size:14px;
}

.unpaid-box{
    width:34px;
    height:34px;
    border-radius:10px;
    background:#fee2e2;
    color:#dc2626;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:auto;
    font-size:14px;
}
/* FIX FINAL LAYOUT */

/* REKAP */

.rekap-table{
    width:100%;
    border-collapse:collapse;
    min-width:1400px;
}

.rekap-table th{
    background:#111827;
    color:#fff;
    padding:14px;
    font-size:13px;
    text-align:center;
    white-space:nowrap;
}

.rekap-table td{
    border-bottom:1px solid #f1f1f1;
    padding:14px;
    text-align:center;
    background:#fff;
}

.rekap-nama{
    min-width:240px;
    text-align:left !important;
    position:sticky;
    left:0;
    z-index:2;
    background:#fff !important;
}

.paid-nominal{
    min-width:50px;
    padding:8px 10px;
    border-radius:10px;
    background:#dcfce7;
    color:#16a34a;
    font-size:13px;
    font-weight:700;
    text-align:center;
}

.unpaid-nominal{
    min-width:50px;
    padding:8px 10px;
    border-radius:10px;
    background:#fee2e2;
    color:#dc2626;
    font-size:13px;
    font-weight:700;
    text-align:center;
}

.total-col{
    font-weight:700;
    background:#f9fafb !important;
    min-width:140px;
    white-space:nowrap;
}

/* REKAP */

.rekap-table{
    width:100%;
    border-collapse:collapse;
    min-width:1600px;
}

.rekap-table th{
    background:#111827;
    color:#fff;
    padding:14px;
    font-size:13px;
    text-align:center;
    white-space:nowrap;
}

.rekap-table td{
    border-bottom:1px solid #f1f1f1;
    padding:14px;
    text-align:center;
    background:#fff;
}

.rekap-nama{
    min-width:240px;
    text-align:left !important;
    position:sticky;
    left:0;
    z-index:2;
    background:#fff !important;
}

.paid-nominal{
    min-width:50px;
    padding:8px 10px;
    border-radius:10px;
    background:#dcfce7;
    color:#16a34a;
    font-size:13px;
    font-weight:700;
    text-align:center;
}

.unpaid-nominal{
    min-width:50px;
    padding:8px 10px;
    border-radius:10px;
    background:#fee2e2;
    color:#dc2626;
    font-size:13px;
    font-weight:700;
    text-align:center;
}

.total-col{
    font-weight:700;
    background:#f9fafb !important;
    min-width:140px;
    white-space:nowrap;
}

.belum-bayar-col{
    min-width:220px;
    font-size:13px;
    color:#dc2626;
    font-weight:600;
    text-align:left !important;
}

.lunas-full{
    color:#16a34a;
    font-weight:700;
}

.modal-custom{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    justify-content:center;
    align-items:center;
    z-index:9999;
    padding:20px;
}

.modal-content-custom{
    width:90%;
    max-width:900px;
    background:#fff;
    border-radius:16px;
    padding:20px;
    max-height:90vh;
    overflow-y:auto;
}





.dashboard-menu{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-top:25px;
}

.dashboard-card{
    background:#fff;
    border-radius:24px;
    padding:30px;
    text-decoration:none;
    color:#111827;
    text-align:center;
    box-shadow:0 4px 20px rgba(0,0,0,.04);
    transition:.25s;
}

.dashboard-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.dashboard-card i{
    display:block;
    font-size:42px;
    margin-bottom:15px;
    color:#16a34a;
}

.dashboard-card span{
    display:block;
    font-size:15px;
    font-weight:600;
}

.logout-card i{
    color:#dc2626;
}


/* DASHBOARD WARGA */

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:20px;
    margin-top:20px;
}

.menu-box{
    display:flex !important;
    flex-direction:column;
    justify-content:center;
    align-items:center;

    background:#ffffff;
    border-radius:20px;
    min-height:160px;

    text-decoration:none !important;
    color:#111827 !important;

    box-shadow:0 4px 20px rgba(0,0,0,.05);
    transition:.25s;
}

.menu-box:hover{
    transform:translateY(-4px);
}

.menu-box i{
    font-size:42px;
    color:#16a34a;
    margin-bottom:15px;
}

.menu-box span{
    font-size:16px;
    font-weight:600;
}




.gallery-admin{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    padding:20px;
    align-items:flex-start;
}

.gallery-card{
    width:180px;
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.gallery-card img{
    width:100%;
    height:120px;
    object-fit:cover;
    display:block;
}



.gallery-action{
    text-align:center;
}