/* ========================================
   PETIR DASHBOARD STYLE
   Persaudaraan Timur Raya
   ======================================== */

:root {
    --primary: #1e5eff;
    --primary-dark: #0d4fd9;
    --primary-light: #4d7eff;
    --dark: #081c4d;
    --dark2: #06163d;
    --success: #22c55e;
    --warning: #ff9f1a;
    --purple: #8b5cf6;
    --danger: #ef4444;
    --bg: #f3f7fd;
    --gray-100: #f8fafc;
    --gray-200: #eef2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e1;
    --gray-500: #94a3b8;
    --gray-600: #64748b;
    --gray-700: #475569;
    --gray-800: #1e293b;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ======================
SIDEBAR
====================== */

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--dark), var(--dark2));
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 25px;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-box {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.logo-area h3 {
    margin: 0;
    font-weight: 700;
    font-size: 20px;
}

.logo-area span {
    font-size: 11px;
    opacity: .7;
}

.menu-title {
    font-size: 11px;
    text-transform: uppercase;
    opacity: .6;
    letter-spacing: 1px;
    margin: 20px 0 10px;
}

.menu {
    list-style: none;
    padding: 0;
}

.menu li {
    margin-bottom: 8px;
}

.menu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    transition: all 0.25s;
    font-size: 14px;
    font-weight: 500;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.menu .active a {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 8px 20px rgba(30, 94, 255, 0.3);
}

.menu a i {
    width: 22px;
    font-size: 16px;
}

.sidebar-footer {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.sidebar-footer-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sidebar-footer strong {
    font-size: 14px;
}

.sidebar-footer small {
    font-size: 11px;
    opacity: .7;
}

/* ======================
OVERLAY SIDEBAR
====================== */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ======================
CONTENT
====================== */

.content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 25px 30px;
    transition: all 0.3s ease;
}

/* ======================
TOPBAR
====================== */

.topbar {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.topbar h4 {
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 20px;
    color: var(--gray-800);
}

.topbar small {
    font-size: 13px;
    color: var(--gray-500);
}

.top-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--gray-100);
    border-radius: 12px;
    position: relative;
    transition: all 0.25s;
    color: var(--gray-600);
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
}

.badge-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.mobile-toggle {
    display: none;
    margin-right: 15px;
}

/* ======================
STATS CARDS - Perbaikan
====================== */

.stat-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card small:first-of-type {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-card h2 {
    font-weight: 700;
    font-size: 28px;
    margin: 4px 0;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-card h5 {
    font-weight: 700;
    font-size: 18px;
    margin: 4px 0;
    color: var(--gray-800);
}

.stat-card .trend-up {
    color: var(--success);
    font-size: 11px;
}

.stat-card .trend-down {
    color: var(--danger);
    font-size: 11px;
}

/* ======================
CARD BOX
====================== */

.card-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    
    transition: all 0.3s ease;
}

.card-box:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-800);
}

.section-header a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.section-header a:hover {
    text-decoration: underline;
}

/* ======================
TABLE
====================== */

.table {
    margin-bottom: 0;
}

.table th {
    border: none;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-500);
    padding: 12px 8px 12px 0;
}

.table td {
    vertical-align: middle;
    padding: 12px 8px 12px 0;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.table tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 12px;
}

.badge.bg-success {
    background: #DCFCE7 !important;
    color: #166534;
}

.badge.bg-warning {
    background: #FEF3C7 !important;
    color: #92400E;
}

.badge.bg-danger {
    background: #FEE2E2 !important;
    color: #991B1B;
}

.badge.bg-info {
    background: #DBEAFE !important;
    color: #1E40AF;
}

/* ======================
ACTIVITY ITEM
====================== */

.activity-item {
    display: flex;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-200);
}

.activity-item:last-child {
    border: none;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #EEF4FF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.activity-content h6 {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.activity-content small {
    color: var(--gray-500);
    font-size: 12px;
}

.activity-content small i {
    margin-right: 4px;
}

/* ======================
BUTTONS
====================== */

.btn-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    text-decoration: none;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: white;
}

/* ======================
FORM
====================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 94, 255, 0.1);
}

/* ======================
CHART CONTAINER
====================== */

#chart, #pie {
    width: 100%;
    min-height: 300px;
}

/* ======================
TOOLTIP
====================== */

.tooltip-custom {
    position: relative;
}

.tooltip-custom:hover:after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 100;
}

/* ======================
RESPONSIVE
====================== */

@media(max-width: 1200px) {
    .stat-card h2 {
        font-size: 26px;
    }
    .stat-icon {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}

@media(max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    .content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    .mobile-toggle {
        display: block;
    }
    .topbar {
        padding: 12px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }
    .topbar h4 {
        font-size: 18px;
    }
    .topbar small {
        font-size: 11px;
    }
    .top-icons {
        margin-left: auto;
    }
    #chart, #pie {
        min-height: 250px;
    }
}

@media(max-width: 768px) {
    .stat-card {
        padding: 16px;
        gap: 12px;
    }
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 14px;
    }
    .stat-card h2 {
        font-size: 22px;
    }
    .stat-card small:first-of-type {
        font-size: 12px;
    }
    .card-box {
        padding: 18px;
    }
    .section-header h5 {
        font-size: 16px;
    }
    .table th,
    .table td {
        font-size: 12px;
        padding: 10px 6px 10px 0;
    }
    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .activity-content h6 {
        font-size: 13px;
    }
    .activity-content small {
        font-size: 11px;
    }
    .topbar h4 {
        font-size: 16px;
    }
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media(max-width: 480px) {
    .content {
        padding: 10px;
    }
    .topbar {
        padding: 10px 15px;
    }
    .topbar h4 {
        font-size: 14px;
    }
    .topbar small {
        display: none;
    }
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .badge-dot {
        width: 14px;
        height: 14px;
        font-size: 8px;
        top: -4px;
        right: -4px;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 12px;
    }
    .stat-card h2 {
        font-size: 20px;
    }
    .stat-card small:first-of-type {
        font-size: 11px;
    }
    .card-box {
        padding: 14px;
    }
    .table th,
    .table td {
        font-size: 11px;
        padding: 8px 4px 8px 0;
    }
}
/* ======================
ICON STYLES - PERBAIKAN TOTAL
====================== */

/* Pastikan icon menggunakan font yang benar */
.stat-icon i,
.activity-icon i,
.icon-btn i,
.logo-box i,
.sidebar-footer-img i,
.btn i {
    display: inline-block;
}

/* STATS CARDS ICON */
.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 24px;
    color: white;
}

/* Warna background icon */
.stat-icon.blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-icon.green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #ffb020); }
.stat-icon.purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }