/* =========================================================
   MIJ ENTERPRISE DASHBOARD STYLESHEET - SYSTEM v3.2 (TOP AUTH)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --primary: #0062FF;
    --primary-light: #E0F2FE;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.15); 
    --radius-pill: 999px;
    --radius-xl: 24px; 
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background-color: #E2E8F0; 
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(52, 211, 153, 0.15) 0px, transparent 50%);
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5vh 2.5vw; 
}

.app-layout {
    display: flex; width: 100%; max-width: 1536px; height: 100%; max-height: 100%; 
    overflow: hidden; background-color: var(--bg-base); border-radius: var(--radius-xl); 
    box-shadow: var(--shadow-float); border: 1px solid rgba(255, 255, 255, 0.8); 
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width); height: 100%; background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color); display: flex; flex-direction: column;
    padding: 24px; flex-shrink: 0; z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, opacity 0.2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.sidebar-brand img { height: 40px; width: auto; }
.sidebar-brand-text h2 { font-size: 0.95rem; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.sidebar-brand-text p { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow: hidden;}
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 700; border-radius: var(--radius-sm); transition: all 0.2s ease; white-space: nowrap; }
.menu-item:hover { background-color: var(--bg-base); color: var(--text-main); }
.menu-item.active { background-color: var(--primary-light); color: var(--primary); }
.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border-color); white-space: nowrap; }

.sidebar-collapsed .sidebar { width: 0px; padding: 24px 0px; opacity: 0; border-right: none; pointer-events: none; }

/* --- MAIN VIEWPORT --- */
.main-viewport { flex: 1; display: flex; flex-direction: column; height: 100%; min-height: 0; background-color: var(--bg-base); }

/* --- TOP NAVBAR --- */
.top-navbar { height: var(--topbar-height); background-color: transparent; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; flex-shrink: 0; }
.top-navbar-left { display: flex; align-items: center; gap: 16px; }
.btn-toggle { background: none; border: none; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--radius-sm); transition: background 0.2s; }
.btn-toggle:hover { background-color: rgba(0, 0, 0, 0.05); }
.page-title h1 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }

/* REVISI: AUTH ZONE KANAN ATAS */
.user-profile-zone { display: flex; align-items: center; gap: 20px; }
.logo-accreditation-row { display: flex; align-items: center; gap: 16px; border-right: 1px solid var(--border-color); padding-right: 20px; }
.logo-accreditation-row img { height: 24px; width: auto; filter: grayscale(100%); opacity: 0.4; }

.auth-box { display: flex; align-items: center; gap: 10px; }
.user-email-text { background: var(--primary-light); color: var(--primary); padding: 6px 14px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 700; border: 1px solid rgba(0, 98, 255, 0.1); }
.btn-sm { padding: 6px 14px !important; font-size: 0.75rem !important; border-radius: var(--radius-pill) !important; }

/* --- CONTENT BODY --- */
.content-body { flex: 1; padding: 10px 32px 32px 32px; overflow-y: auto; min-height: 0; }
.content-body::-webkit-scrollbar { width: 8px; }
.content-body::-webkit-scrollbar-track { background: transparent; }
.content-body::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* --- UI CONTROLS & CARDS --- */
.dashboard-card { background-color: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border-color); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.button { padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.8rem; cursor: pointer; border: none; transition: all 0.2s ease; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button-primary { background-color: var(--primary); color: white; }
.button-primary:hover { background-color: var(--primary-hover); }
.button-secondary { background-color: #E2E8F0; color: var(--text-main); }
.button-secondary:hover { background-color: #CBD5E1; }

.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; background-color: var(--bg-base); padding: 16px 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 20px; }
.filters div { display: flex; flex-direction: column; gap: 6px; }
.filters label { font-size: 0.7rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.filters input, .filters select {
    padding: 8px 14px; border: 1px solid #CBD5E1; border-radius: var(--radius-sm);
    background: white; font-family: inherit; font-weight: 600; font-size: 0.85rem; color: var(--text-main);
}
.filters input:focus, .filters select:focus { border-color: var(--primary); outline: none; }

/* --- DATA TABLE DESIGN --- */
.table-container { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background-color: var(--bg-surface); width: 100%; }
.table-container::-webkit-scrollbar { height: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--bg-base); }
.table-container::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: auto; }
th { background-color: #F8FAFC; padding: 12px 10px; text-transform: uppercase; font-size: 0.65rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.05em; text-align: left; border-bottom: 1px solid var(--border-color); }
tr td { padding: 12px 10px; font-size: 0.8rem; font-weight: 500; border-bottom: 1px solid var(--border-color); background-color: var(--bg-surface); word-break: break-word; }
tr:hover td { background-color: #F8FAFC; }

.status-chip { padding: 4px 8px; border-radius: var(--radius-pill); font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; display: inline-block; text-align: center; }
.status-Pending { background: #FEF3C7; color: #B45309; }
.status-Ditugaskan { background: #E0F2FE; color: #0369A1; }
.status-Dalam-Perjalanan { background: #EDE9FE; color: #6D28D9; }
.status-Selesai { background: #DCFCE7; color: #15803D; }
.status-Dibatalkan { background: #FEE2E2; color: #B91C1C; }

.actions select, .actions button { width: 100%; padding: 6px 8px; margin-bottom: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); font-size: 0.7rem; font-family: inherit; font-weight: 700; }
.actions button { background: var(--text-main); color: white; border: none; cursor: pointer; }
.actions button:hover { background: var(--primary); }

.map-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.map-link:hover { text-decoration: underline; }
.wa-link { background: var(--success); color: white; font-size: 0.65rem; padding: 2px 6px; border-radius: var(--radius-sm); margin-left: 4px; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

.reminder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.reminder-card { background: white; border-radius: var(--radius-md); padding: 14px 20px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.reminder-icon { padding: 10px; border-radius: 8px; display: flex; }
.reminder-high { border-left: 4px solid var(--danger); }
.reminder-high .reminder-icon { background: #FEE2E2; color: var(--danger); }
.reminder-medium { border-left: 4px solid var(--warning); }
.reminder-medium .reminder-icon { background: #FEF3C7; color: var(--warning); }
.reminder-title { font-weight: 800; font-size: 0.85rem; }
.reminder-msg { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.pagination-container { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }
.page-info { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.btn-page { background: white; border: 1px solid var(--border-color); padding: 6px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.btn-page:hover:not(:disabled) { background: #F8FAFC; }
.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- FORMULIR --- */
.warning-box { background-color: rgba(245, 158, 11, 0.15); border-left: 4px solid var(--warning); color: #92400e; padding: 16px 20px; margin-top: 24px; border-radius: var(--radius-sm); font-size: 0.8rem; line-height: 1.6; }
.warning-box strong { display: block; margin-bottom: 8px; color: #b45309; font-size: 0.9rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 24px; }
@media (min-width: 900px) { .form-grid { grid-template-columns: 1fr 1fr; } .grid-col-span-2 { grid-column: span 2; } }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em;}
.form-group input, .form-group select, .form-group textarea { width: 100%; background-color: #F8FAFC; color: var(--text-main); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.85rem; font-family: inherit; font-weight: 500; transition: all 0.2s ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; background-color: white; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-group textarea { min-height: 100px; resize: vertical; }
#map { border: 1px solid var(--border-color); border-radius: var(--radius-sm); z-index: 10; }
.status-message { padding: 16px; border-radius: var(--radius-sm); text-align: center; margin-top: 24px; font-weight: 600; font-size: 0.85rem; }
.status-message.success { background-color: #DCFCE7; color: #15803D; }
.status-message.error { background-color: #FEE2E2; color: #B91C1C; }

/* --- RESPONSIVITAS MOBILE --- */
@media (max-width: 900px) {
    body { padding: 0; }
    .app-layout { flex-direction: column; border-radius: 0; border: none; box-shadow: none; }
    .sidebar { width: 100%; height: auto; padding: 15px 20px; border-right: none; border-bottom: 1px solid var(--border-color); z-index: 10; }
    .sidebar-brand { margin-bottom: 12px; padding-bottom: 0; border-bottom: none; }
    .sidebar-menu { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
    .menu-item { white-space: nowrap; } 
    .sidebar-footer { display: none; } /* Sembunyikan footer di HP */
    .sidebar-collapsed .sidebar { display: none !important; }
    
    .main-viewport { width: 100%; min-height: 0; }
    
    /* REVISI NAVBAR HP: Sembunyikan Logo Akreditasi agar tombol Auth muat */
    .logo-accreditation-row { display: none; }
    .top-navbar { padding: 15px 20px; height: auto; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
    .page-title h1 { font-size: 1.1rem; }
    
    .content-body { padding: 15px; }
    .dashboard-card { padding: 15px; }
    .table-container { width: 100%; max-width: calc(100vw - 30px); overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    table { min-width: 1300px !important; }
    .filters { flex-direction: column; align-items: stretch; gap: 12px; }
    .filters div { width: 100%; }
    .reminder-grid { grid-template-columns: 1fr; }
    .actions select, .actions button { padding: 10px; font-size: 0.8rem; }
}