:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #38bdf8;
    --sidebar-active-bg: #1e293b;

    --border-radius-card: 12px;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
}

/* Workspace Layout (Mobile Baseline) */
.app-layout, .workspace-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-bottom: 60px; /* Ruang aman untuk mobile bottom nav */
}

/* Sidebar / Mobile Bottom Navigation Bar */
.app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid #1e293b;
    box-sizing: border-box;
    padding: 0 4px;
}

.sidebar-brand, .sidebar-footer {
    display: none; /* Disembunyikan di tampilan mobile */
}

.sidebar-nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    justify-content: space-around;
    align-items: center;
    gap: 2px;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 4px 2px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    text-align: center;
    transition: background 0.2s;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* Main Content Area */
.app-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.topbar-title {
    font-size: 16px;
    color: var(--text-main);
    margin: 0;
    font-weight: 600;
}

.topbar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #e0f2fe;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}

.app-content-outlet {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    background-color: var(--bg-main);
}

/* UI Components */
.card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    box-sizing: border-box;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-weight: bold;
    text-align: left;
}


/* ==========================================================================
   DESKTOP & TABLET ENHANCEMENTS (Sidebar di Sebelah Kiri untuk Layar >= 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .app-layout, .workspace-layout {
        flex-direction: row; /* Sidebar di kiri, main content di kanan */
        height: 100vh;
        overflow: hidden;
        padding-bottom: 0;
    }

    .app-sidebar {
        position: relative;
        bottom: auto;
        left: auto;
        width: 260px;
        height: 100vh;
        flex-shrink: 0;
        border-right: 1px solid #1e293b;
        border-top: none;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 0;
    }

    .sidebar-brand {
        display: flex;
        padding: 24px 20px;
        font-size: 18px;
        font-weight: bold;
        border-bottom: 1px solid #1e293b;
        color: var(--sidebar-active);
        align-items: center;
        gap: 8px;
    }

    .sidebar-badge {
        font-size: 9px;
        background: var(--sidebar-active);
        color: var(--sidebar-bg);
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: bold;
    }

    .sidebar-nav {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 16px 12px;
        gap: 6px;
        flex: 1;
        align-items: stretch;
    }

    .nav-link {
        flex-direction: row;
        padding: 10px 14px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        flex: unset;
        text-align: left;
        gap: 10px;
    }

    .nav-link.active {
        background-color: var(--sidebar-active-bg);
        color: var(--sidebar-active);
    }

    .sidebar-footer {
        display: block;
        padding: 16px 20px;
        border-top: 1px solid #1e293b;
        font-size: 12px;
        color: #94a3b8;
    }

    .app-main {
        height: 100vh;
        overflow-y: auto;
        flex: 1;
    }

    .app-topbar {
        padding: 16px 32px;
        height: 70px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .app-content-outlet {
        padding: 32px;
    }

    .card {
        padding: 24px;
    }
}
