:root {
    --pkk-dark: #1B5E20;
    --pkk-green: #2E7D32;
    --pkk-mid: #388E3C;
    --pkk-light: #4CAF50;
    --pkk-lighter: #81C784;
    --pkk-bg: #E8F5E9;
    --pkk-pale: #f1f8f2;
    --sidebar-w: 256px;
    --topbar-h: 58px;
}

* { font-family: 'Outfit', sans-serif; }

body { background: var(--pkk-pale); overflow-x: hidden; margin: 0; }

/* ===== LOGIN ===== */
.login-page {
    background: var(--pkk-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header i { font-size: 52px; color: var(--pkk-light); }
.login-header h3 { color: var(--pkk-dark); font-weight: 700; margin: 8px 0 4px; }
.login-header p { color: #777; font-size: 14px; margin: 0; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--pkk-dark);
    color: #fff; z-index: 1040;
    transition: transform .25s ease;
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar.collapsed { transform: translateX(calc(var(--sidebar-w) * -1)); }
.sidebar-brand {
    padding: 16px 20px;
    font-size: 20px; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
    letter-spacing: .3px;
}
.sidebar-brand i { color: var(--pkk-lighter); font-size: 24px; }
.sidebar-nav { padding: 10px 0; }
.sidebar-nav .nav-link {
    color: rgba(255,255,255,.65);
    padding: 11px 20px;
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
    font-size: 14px; font-weight: 400;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.12);
    border-left-color: var(--pkk-lighter);
    font-weight: 500;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 15px; }

/* ===== TOPBAR ===== */
.topbar {
    position: fixed; top: 0;
    left: var(--sidebar-w); right: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8e3;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
    transition: left .25s ease;
}
.topbar.expanded { left: 0; }
.sidebar-toggle { color: var(--pkk-dark); font-size: 18px; background: none; border: none; cursor: pointer; padding: 4px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 8px; color: #333; font-size: 14px; }
.user-info .badge { font-size: 10px; font-weight: 500; }

/* ===== MAIN ===== */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-h));
    transition: margin-left .25s ease;
}
.main-content.expanded { margin-left: 0; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-weight: 700; color: var(--pkk-dark); margin: 0; font-size: 22px; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff; border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    border-left: 4px solid var(--pkk-light);
    transition: transform .15s, box-shadow .15s;
    height: 100%;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
}
.stat-icon.bg-green { background: var(--pkk-light); }
.stat-icon.bg-blue { background: #2196F3; }
.stat-icon.bg-orange { background: #FF9800; }
.stat-icon.bg-red { background: #E53935; }
.stat-icon.bg-teal { background: #00897B; }
.stat-value { font-size: 26px; font-weight: 700; color: #1a1a1a; margin-top: 12px; }
.stat-label { font-size: 13px; color: #777; margin-top: 2px; }

/* ===== TABLE ===== */
.table-container {
    background: #fff; border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.table { font-size: 14px; }
.table thead th {
    background: var(--pkk-bg);
    color: var(--pkk-dark);
    font-weight: 600; font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--pkk-lighter);
    white-space: nowrap;
}
.table td { vertical-align: middle; }

/* ===== BADGES ===== */
.badge-hadir { background-color: #4CAF50 !important; }
.badge-izin { background-color: #2196F3 !important; }
.badge-sakit { background-color: #FF9800 !important; }
.badge-alpa { background-color: #E53935 !important; }
.badge-lunas { background-color: #4CAF50 !important; }
.badge-belum { background-color: #E53935 !important; }
.badge-rencana { background-color: #2196F3 !important; }
.badge-selesai { background-color: #4CAF50 !important; }
.badge-dibatalkan { background-color: #9E9E9E !important; }
.badge-pemasukan { background-color: #4CAF50 !important; }
.badge-pengeluaran { background-color: #E53935 !important; }

/* ===== BUTTONS ===== */
.btn-success { background-color: var(--pkk-green); border-color: var(--pkk-green); }
.btn-success:hover { background-color: var(--pkk-dark); border-color: var(--pkk-dark); }
.btn-outline-success { color: var(--pkk-green); border-color: var(--pkk-green); }
.btn-outline-success:hover { background-color: var(--pkk-green); border-color: var(--pkk-green); color: #fff; }

/* ===== FORMS ===== */
.form-control:focus, .form-select:focus {
    border-color: var(--pkk-light);
    box-shadow: 0 0 0 .2rem rgba(76,175,80,.18);
}

/* ===== CARDS ===== */
.card-section {
    background: #fff; border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    margin-bottom: 24px;
}
.card-section h5 {
    font-weight: 600; color: var(--pkk-dark);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--pkk-bg);
}

/* ===== FLASH ===== */
.flash-container {
    position: fixed; top: 16px; left: 50%;
    transform: translateX(-50%); z-index: 9999;
    width: 90%; max-width: 500px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    background: #fff; border-radius: 12px;
    padding: 16px 20px; margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; display: block; }

/* ===== DETAIL PAGE ===== */
.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.detail-label { width: 200px; font-weight: 600; color: #555; font-size: 14px; flex-shrink: 0; }
.detail-value { color: #222; font-size: 14px; }

/* ===== CALENDAR VIEW ===== */
.calendar-date {
    background: var(--pkk-bg);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.calendar-date h6 { color: var(--pkk-dark); font-weight: 700; margin-bottom: 8px; }
.calendar-item {
    background: #fff; border-radius: 6px;
    padding: 10px 14px; margin-bottom: 6px;
    border-left: 3px solid var(--pkk-light);
    font-size: 14px;
}

/* ===== ANNOUNCEMENT ===== */
.announcement-card {
    border-left: 4px solid var(--pkk-light);
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 0 8px 8px 0;
}
.announcement-card h6 { color: var(--pkk-dark); font-weight: 600; margin-bottom: 4px; }
.announcement-card p { color: #555; font-size: 13px; margin: 0; }
.announcement-card small { color: #999; }

/* ===== PRINT ===== */
@media print {
    .sidebar, .topbar, .no-print, .btn, .filter-bar { display: none !important; }
    .main-content { margin: 0 !important; padding: 12px !important; }
    .table-container { box-shadow: none; padding: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(calc(var(--sidebar-w) * -1)); }
    .sidebar.show { transform: translateX(0); }
    .topbar { left: 0; }
    .main-content { margin-left: 0; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .detail-row { flex-direction: column; }
    .detail-label { width: auto; margin-bottom: 2px; }
}
