/* ============================================================
   laporan.css — SIPDAM Premium Dashboard
   Inspired by modern clean UI aesthetics
   ============================================================ */

:root {
    --dash-bg:       #f8fafc;
    --dash-card-bg:  #ffffff;
    --dash-primary:   #0f172a;
    --dash-accent:    #10b981;
    --dash-danger:    #ef4444;
    --dash-warning:   #f59e0b;
    --dash-info:      #3b82f6;
    --dash-border:    #e2e8f0;
    --dash-text:      #1e293b;
    --dash-text-m:    #64748b;
    --dash-shadow:    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --dash-radius:    12px;
}

.db-wrap {
    background-color: var(--dash-bg);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--dash-text);
}

/* Robust Grid System */
.row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: -12px !important;
    margin-left: -12px !important;
}

.col-xl-3, .col-lg-3, .col-md-6, .col-12, .col-lg-6, .col-xl-6 {
    position: relative;
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 25% !important; max-width: 25% !important; }
    .col-xl-6 { flex: 0 0 50% !important; max-width: 50% !important; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25% !important; max-width: 25% !important; }
    .col-lg-6 { flex: 0 0 50% !important; max-width: 50% !important; }
}

@media (min-width: 768px) {
    .col-md-6 { flex: 0 0 50% !important; max-width: 50% !important; }
}

/* Robust Flex Utilities */
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* Tab Navigation Style */
.report-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nav-item-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    color: var(--dash-text);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--dash-shadow);
}

.nav-item-custom:hover {
    background: #f1f5f9;
    color: var(--dash-primary);
}

.nav-item-custom.active {
    background: #f1f5f9;
    border-color: var(--dash-primary);
    color: var(--dash-primary);
}

.nav-item-custom i {
    font-size: 1.1rem;
    color: var(--dash-text-m);
}

/* Header Section */
.dash-header {
    margin-bottom: 30px;
}

.dash-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dash-primary);
    margin-bottom: 4px;
}

.dash-subtitle {
    color: var(--dash-text-m);
    font-size: 0.95rem;
}

/* Clean Summary Cards */
.sum-card {
    background: white;
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 24px;
    height: 100%;
    transition: transform 0.2s ease;
}

.sum-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

.sum-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dash-text-m);
    margin-bottom: 12px;
    display: block;
}

.sum-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dash-primary);
    margin-bottom: 4px;
    display: block;
}

.sum-value.success { color: var(--dash-accent); }
.sum-value.danger { color: var(--dash-danger); }

.sum-subtext {
    font-size: 0.875rem;
    color: var(--dash-text-m);
}

/* Filter Bar */
.filter-bar {
    background: white;
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-input-group {
    position: relative;
    flex-grow: 1;
}

.search-input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dash-text-m);
}

.search-input-group input {
    padding-left: 40px;
    border-radius: 8px;
    border: 1px solid var(--dash-border);
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Modern Table */
.modern-table-card {
    background: white;
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
    box-shadow: var(--dash-shadow);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    background: #f8fafc;
    padding: 16px 20px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dash-text-m);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--dash-border);
}

.modern-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* Avatar Circle */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dash-text-m);
    font-size: 0.9rem;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--dash-border);
}

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

.avatar-name {
    font-weight: 700;
    color: var(--dash-primary);
    font-size: 0.95rem;
}

.avatar-role {
    font-size: 0.8rem;
    color: var(--dash-text-m);
}

/* Pill Badges */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-success {
    background: #ecfdf5;
    color: #065f46;
}
.badge-success::before { background: #10b981; }

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}
.badge-pending::before { background: #f59e0b; }

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}
.badge-danger::before { background: #ef4444; }

.badge-info {
    background: #eff6ff;
    color: #1e40af;
}
.badge-info::before { background: #3b82f6; }

/* Buttons */
.btn-ekspor {
    background: white;
    border: 1px solid var(--dash-border);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dash-text);
}

.btn-ekspor:hover {
    background: #f1f5f9;
}

/* Month Select */
.month-select {
    border: 1px solid var(--dash-border);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    background: white;
}

@media (max-width: 768px) {
    .report-nav {
        flex-direction: column;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Detail Modal Styles --- */
.abs-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.abs-overlay.show { display: flex; }

.abs-modal {
    background: #fff;
    width: 100%;
    max-width: 550px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}
.abs-modal-lg { max-width: 800px; }

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.abs-modal-header {
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.abs-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}
.abs-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.abs-close-btn:hover { background: #e2e8f0; color: #0f172a; }

.abs-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

/* --- Preview Foto Styles --- */
.abs-preview-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}
.abs-preview-overlay.show { display: flex; }
.abs-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.abs-preview-x {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
