/* ================================================
   PIJAR - Stylesheet
   UKPBJ Kementerian Keuangan
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&display=swap');

/* --- THEME VARIABLES --- */
:root {
    --navy: #0f172a;
    --navy-light: #1e293b;
    --gold: #fbbf24;
    --gold-hover: #d97706;
    --white: #ffffff;
    --gray-bg: #f8fafc;
    --gray-text: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --success: #10b981;
    --success-bg: #dcfce7;
    --info: #3b82f6;
    --info-bg: #dbeafe;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Urbanist', sans-serif; }
body { background-color: var(--gray-bg); color: var(--navy); min-height: 100vh; }

/* --- UTILITIES --- */
.hidden { display: none !important; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.gap-5 { gap: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.text-muted { color: var(--gray-text); }
.font-bold { font-weight: 700; }
.text-red { color: var(--danger); }
.text-green { color: var(--success); }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.w-100 { width: 100%; }

/* --- BADGES --- */
.badge { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.bg-red { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.bg-yellow { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.bg-green { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.bg-blue { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }

/* --- BUTTONS --- */
.btn { cursor: pointer; border: none; outline: none; transition: 0.2s; padding: 10px 20px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--gold); color: var(--navy); }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--navy); }
.btn-outline:hover { background: var(--gray-bg); border-color: var(--navy); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-action-contrast { background: var(--navy); color: white; padding: 6px 12px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; transition: 0.2s; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.btn-action-contrast:hover { background: var(--gold); color: var(--navy); }

/* --- FORMS --- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; font-family: 'Urbanist', sans-serif; transition: 0.2s; background: white; }
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15,23,42,0.08); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* --- ANIMATION --- */
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- LAYOUT --- */
.navbar {
    background: var(--white); height: 70px; border-bottom: 1px solid var(--border);
    padding: 0 40px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; color: inherit; }
.navbar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.navbar-avatar { width: 35px; height: 35px; background: var(--navy); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

.main-content { padding: 30px 40px; min-height: calc(100vh - 70px); }
.content-width { max-width: 1400px; margin: 0 auto; }
.card { background: white; border-radius: 12px; padding: 25px; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); margin-bottom: 20px; }

/* --- FLASH MESSAGES --- */
.alert { padding: 14px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid rgba(16,185,129,0.3); }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid rgba(245,158,11,0.3); }
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid rgba(59,130,246,0.3); }

/* --- LOGIN --- */
.login-container { width: 100%; min-height: 100vh; display: flex; background: linear-gradient(135deg, var(--navy) 0%, #1e3a8a 100%); }
.login-left { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; text-align: center; padding: 40px; }
.login-right { width: 450px; background: white; display: flex; flex-direction: column; justify-content: center; padding: 50px; box-shadow: -10px 0 30px rgba(0,0,0,0.2); }

/* --- DASHBOARD --- */
.hero-card { background: linear-gradient(to right, var(--navy), #334155); color: white; display: flex; justify-content: space-between; align-items: center; border: none; padding: 30px; border-radius: 12px; margin-bottom: 25px; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-bottom: 30px; }
.module-card {
    background: white; border-radius: 16px; padding: 30px; border: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; transition: 0.2s; position: relative; text-decoration: none; color: inherit;
}
.module-card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.dashboard-grid { display: grid; grid-template-columns: 2.5fr 1fr; gap: 30px; }

/* News */
.news-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.news-item:last-child { border: none; margin: 0; padding: 0; }
.news-date { font-size: 11px; color: var(--gold); font-weight: bold; text-transform: uppercase; }
.news-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-top: 3px; display: block; }
.news-desc { font-size: 12px; color: var(--gray-text); margin-top: 2px; }

/* Task Cards */
.task-card { background: #f8fafc; padding: 15px; border-radius: 8px; border-left: 4px solid var(--navy); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-card.urgent { border-left-color: var(--danger); background: #fef2f2; }

/* --- MANDAT --- */
.mandat-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 25px; }
.mandat-stat-card {
    background: var(--navy); color: white; border-radius: 12px; padding: 20px; position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; height: 120px;
}
.stat-icon-bg { position: absolute; right: -10px; bottom: -10px; font-size: 80px; opacity: 0.1; }

/* Tables */
.custom-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.custom-table th { text-align: left; padding: 15px; background: #f1f5f9; color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--border); }
.custom-table td { padding: 15px; border-bottom: 1px solid var(--border); color: var(--navy-light); vertical-align: middle; }
.custom-table tr:hover { background: #f8fafc; }

/* Paket Cards (Pokja) */
.paket-card {
    background: white; border: 1px solid var(--border); border-radius: 12px; padding: 25px; margin-bottom: 20px;
    border-left: 5px solid var(--gold); position: relative; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s;
}
.paket-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px rgba(0,0,0,0.05); }
.paket-card.late { border-left-color: var(--danger); }
.paket-card.done { background: #f1f5f9; opacity: 0.8; border-left-color: var(--success); }

.step-pill {
    background: #f1f5f9; color: var(--gray-text); font-size: 11px; padding: 5px 10px; border-radius: 6px;
    display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
}
.step-pill.active { background: var(--navy); color: white; border-color: var(--navy); }
.step-pill.danger { background: var(--danger); color: white; border-color: var(--danger); }

/* Sidebar Widgets */
.sidebar-widget { background: white; border: 1px solid var(--border); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; border-bottom: 1px dashed rgba(255,255,255,0.2); padding-bottom: 8px; }
.stat-row:last-child { border: none; margin: 0; padding: 0; }

/* Schedule */
.schedule-item { position: relative; padding-left: 20px; margin-bottom: 15px; border-left: 2px solid var(--border); }
.schedule-item::before { content: ''; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--gray-text); }
.schedule-item.active { border-left-color: var(--gold); }
.schedule-item.active::before { background: var(--gold); }
.schedule-item.urgent { border-left-color: var(--danger); }
.schedule-item.urgent::before { background: var(--danger); }

/* Role Switcher */
.role-switch { background: white; border: 1px solid var(--border); padding: 4px; border-radius: 10px; display: inline-flex; gap: 5px; }
.role-btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--gray-text); transition: 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.role-btn.active { background: var(--navy); color: white; }
.role-btn:hover:not(.active) { background: #f1f5f9; }

/* --- PUSTAKA --- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.folder-card { background: white; border: 1px solid var(--border); padding: 20px; border-radius: 12px; text-align: center; cursor: pointer; transition: 0.2s; text-decoration: none; color: inherit; display: block; }
.folder-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

/* --- RADAR --- */
.radar-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.chart-box { height: 250px; background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--gray-text); font-size: 14px; }

/* --- TODO --- */
.todo-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; padding: 8px; border-radius: 6px; }
.todo-item:hover { background: #f8fafc; }
.todo-text { font-size: 14px; font-weight: 600; }
.todo-done .todo-text { text-decoration: line-through; opacity: 0.6; }

/* --- MODAL --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 16px; padding: 30px; max-width: 600px; width: 95%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-text); padding: 5px; }

/* --- PAGINATION --- */
.pagination { display: flex; gap: 5px; margin-top: 20px; justify-content: center; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.pagination a { background: white; border: 1px solid var(--border); color: var(--navy); }
.pagination a:hover { background: var(--gray-bg); border-color: var(--navy); }
.pagination .active { background: var(--navy); color: white; border: 1px solid var(--navy); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: repeat(2, 1fr); }
    .mandat-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .radar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .navbar { padding: 0 20px; }
    .main-content { padding: 20px; }
    .login-container { flex-direction: column; }
    .login-left { padding: 40px 20px; }
    .login-right { width: 100%; padding: 30px; }
    .module-grid { grid-template-columns: 1fr; }
    .mandat-stats-grid { grid-template-columns: 1fr 1fr; }
    .hero-card { flex-direction: column; gap: 15px; text-align: center; }
}
