/* ==========================================================================
   SI PESONAMU — design system (Neuform)
   Palette: primary #1b2a80 · bg #f6f7fb · surface #eef1fb · text #111827
   ========================================================================== */

:root {
    --ink:            #111827;
    --ink-muted-80:   #4B5563;
    --ink-muted-48:   #9CA3AF;
    --canvas:         #ffffff;
    --parchment:      #f6f7fb;
    --pearl:          #eef1fb;
    --hairline:       rgba(41,37,36,0.12);
    --hairline-soft:  rgba(0,0,0,.04);

    --primary:        #1b2a80;
    --primary-focus:  #12205f;
    --primary-tint:   rgba(27, 42, 128, 0.1);

    --gold:           #c79a2e;
    --pink:           #b4185f;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;

    --font: "Outfit", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--ink);
    background: var(--parchment);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Background Global Three.js Canvas */
.global-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

/* Watermark maskot — file: public/assets/maskot.jpeg */
body::before {
    content: "";
    position: fixed;
    right: -90px;
    bottom: -70px;
    width: 520px;
    height: 650px;
    background: url("/assets/maskot.jpeg") no-repeat center / contain;
    opacity: .09;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: "";
    position: fixed;
    left: 260px;
    top: 40px;
    width: 280px;
    height: 340px;
    background: url("/assets/maskot.jpeg") no-repeat center / contain;
    opacity: .04;
    mix-blend-mode: multiply;
    transform: scaleX(-1);
    pointer-events: none;
    z-index: 0;
}

main, nav, .app-layout, .app-content { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, .fw-bold, .fw-semibold {
    font-family: var(--font);
    letter-spacing: -0.02em;
    font-weight: 800;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   SIDEBAR LAYOUT
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--canvas);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
}

.sidebar-logo {
    height: 130px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--ink-muted-80);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: var(--hairline-soft);
    color: var(--ink);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(27, 42, 128,0.25);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--hairline);
}

.sidebar-link-logout {
    color: var(--ink-muted-48);
}
.sidebar-link-logout:hover {
    color: #dc3545;
    background: #fee2e2;
}

/* ---------- Main Content Area ---------- */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Top Header Bar ---------- */
.app-topbar {
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 60px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--ink);
    padding: 4px;
    cursor: pointer;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
}

.topbar-search i {
    color: var(--ink-muted-48);
    font-size: 14px;
}

.topbar-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    width: 100%;
}

.topbar-search-input::placeholder {
    color: var(--ink-muted-48);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-role-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--primary-tint);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
}

.topbar-icon-btn {
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted-80);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-icon-btn:hover {
    background: var(--hairline-soft);
    color: var(--ink);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-focus));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* ---------- Page Content ---------- */
.app-content {
    flex: 1;
    padding: 32px;
    max-width: 1100px;
}

/* Sidebar mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* ==========================================================================
   OLD NAV (keeping for login/guest pages)
   ========================================================================== */
.navbar {
    background: #ffffff !important;
    min-height: 60px;
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.navbar-brand {
    font-family: var(--font);
    font-weight: 900;
    letter-spacing: .02em;
    font-size: 1.35rem;
    color: var(--primary) !important;
}
.navbar .nav-link, .navbar .navbar-text, .navbar .btn { font-size: 14px; font-weight: 500; }
.navbar .navbar-text { color: var(--ink-muted-80) !important; }
.navbar .btn-outline-light {
    border-radius: var(--radius-pill);
    border: 1px solid var(--hairline);
    color: var(--ink) !important;
    background: transparent;
    padding: 6px 18px;
    font-weight: 600;
}
.navbar .btn-outline-light:hover { background: rgba(0,0,0,0.04); color: var(--ink) !important; }
.navbar .btn-outline-light:active { transform: scale(.96); }

/* ---------- Cards ---------- */
.card {
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.card-body { padding: 24px; }
.card h6 { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted-48); margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-pill);
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 0;
    padding: 10px 20px;
    transition: all .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs, .btn.py-0 { padding: 4px 12px; font-size: 12px; }

.btn-primary, .btn-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-focus) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(27, 42, 128,.25);
}
.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus {
    background: linear-gradient(135deg, #3b57c9 0%, #1b2a80 100%);
    box-shadow: 0 6px 20px rgba(27, 42, 128,.35);
    color: #fff;
}
.btn-outline-primary { color: var(--primary); border: 1.5px solid var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary-tint); color: var(--primary); }
.btn-outline-secondary {
    color: var(--ink-muted-80);
    border: 1.5px solid var(--hairline);
    background: var(--canvas);
}
.btn-outline-secondary:hover { background: var(--pearl); color: var(--ink); border-color: rgba(41,37,36,0.3); }
.btn-outline-danger { border-radius: var(--radius-pill); }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border: 1.5px solid var(--hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    padding: 10px 14px;
    background: #fff;
    transition: all 0.2s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
    outline: none;
}
.form-select-sm, .form-control-sm { font-size: 13px; padding: 8px 12px; }
.form-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-muted-80); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; font-size: 14.5px; }
.table > thead th {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-muted-80);
    border-bottom: 2px solid var(--hairline);
    font-weight: 600;
    padding: 12px;
}
.table > tbody > tr > td { border-color: var(--hairline); padding: 12px; vertical-align: middle; }
.table-success, .table > :not(caption) > * > .table-success {
    --bs-table-bg: var(--primary-tint);
}

/* ---------- Badges ---------- */
.badge { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.04em; border-radius: 999px; padding: 6px 12px; text-transform: uppercase; font-size: 11px; }
.badge.bg-secondary { background: var(--pearl) !important; color: var(--ink-muted-80); border: 1px solid var(--hairline); }
.badge-L { background: var(--primary) !important; color: #fff; }
.badge-P { background: var(--pink) !important; color: #fff; }
.badge.bg-success { background: #dcfce7 !important; color: #166534 !important; }
.badge.bg-info { background: #eef1fb !important; color: #12205f !important; }
.badge.bg-warning { background: #fef08a !important; color: #713f12 !important; }
.badge.bg-danger { background: #fee2e2 !important; color: #991b1b !important; }

/* ---------- Alerts ---------- */
.alert { border: 1px solid var(--hairline); border-radius: var(--radius-md); font-size: 14.5px; padding: 16px; }
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fef9c3; border-color: #fef08a; color: #854d0e; }
.alert-secondary { background: var(--pearl); border-color: var(--hairline); color: var(--ink-muted-80); }
.alert-info { background: #eef1fb; border-color: #dbe2f7; color: #12205f; }

/* ---------- Stat number ---------- */
.fs-3.fw-bold, .fs-4.fw-bold { font-family: var(--font); letter-spacing: -0.02em; font-weight: 800; }
.text-primary { color: var(--primary) !important; }
.text-success { color: #166534 !important; }

/* ---------- Login ---------- */
.login-wrap { min-height: calc(100vh - 52px); display: flex; align-items: center; justify-content: center; }
.login-wrap .card { border-radius: var(--radius-lg); }
.login-brand { text-align:center; font-family:var(--font); font-weight:900; letter-spacing:.02em; font-size:1.6rem; color:var(--primary); }

/* kelompok board */
.kelompok-col { border-radius: var(--radius-lg) !important; background: var(--canvas); border: 1px solid var(--hairline); }

/* kartu kelompok di beranda camaba */
.kartu-kelompok { border: none; background: linear-gradient(180deg, var(--primary-tint) 0%, var(--canvas) 100%); }
.kartu-kelompok .display-6 { font-family: var(--font); font-weight: 800; letter-spacing: -0.02em; color: var(--primary); }

/* ==========================================================================
   DASHBOARD GRID SYSTEM (Reference-based)
   ========================================================================== */

.dashboard-main {
    font-family: 'Outfit', sans-serif;
    color: #1a1a1a;
}

/* Dashboard grid: 2 columns on desktop like reference */
.dash-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .dash-grid {
        grid-template-columns: 7fr 5fr;
    }
}

.dash-grid-full {
    grid-column: 1 / -1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.minimal-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    animation: fadeInUp 0.5s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.minimal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.minimal-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.minimal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.stats-pill-container {
    display: inline-flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    gap: 1.5rem;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}
.stat-divider {
    width: 1px;
    height: 20px;
    background-color: #d1d5db;
}
.minimal-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}
.minimal-btn:hover {
    background: #f3f4f6;
}
.minimal-btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
}
.minimal-btn-primary:hover {
    background: var(--primary-focus);
    color: #fff;
}
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.bg-progress { background: #dcfce7; color: #166534; }
.bg-pending { background: #fce7f3; color: #9d174d; }
.bg-completed { background: #dbeafe; color: #1e40af; }

/* === BENTO GRID DASHBOARD (legacy) === */
.bento-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(12, 1fr);
}

.bento-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.bento-col-3 { grid-column: span 12; }
.bento-col-4 { grid-column: span 12; }
.bento-col-6 { grid-column: span 12; }
.bento-col-8 { grid-column: span 12; }
.bento-col-12 { grid-column: span 12; }

@media (min-width: 768px) {
    .bento-col-3 { grid-column: span 6; }
    .bento-col-4 { grid-column: span 6; }
    .bento-col-6 { grid-column: span 12; }
    .bento-col-8 { grid-column: span 12; }
}

@media (min-width: 992px) {
    .bento-col-3 { grid-column: span 3; }
    .bento-col-4 { grid-column: span 4; }
    .bento-col-6 { grid-column: span 6; }
    .bento-col-8 { grid-column: span 8; }
}

.bento-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid var(--bs-primary);
}
.bento-stat.stat-orange { border-top-color: var(--primary); }
.bento-stat.stat-tosca { border-top-color: #3b57c9; }
.bento-stat.stat-blue { border-top-color: var(--primary); }
.bento-stat.stat-danger { border-top-color: #dc3545; }

.bento-title {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.bento-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #212529;
}

.bento-header-wrapper {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed rgba(14, 165, 168, 0.2);
}

/* ==========================================================================
   RESPONSIVE: SIDEBAR
   ========================================================================== */

/* Mobile: hide sidebar, show hamburger */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .app-content {
        padding: 24px 16px;
    }
    .topbar-search {
        max-width: 280px;
    }
}

/* Small mobile tweaks */
@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .app-content { padding: 16px 12px; }
    h4 { font-size: 1.25rem; }
    .card-body { padding: 16px; }
    .topbar-search { display: none; }
    .topbar-role-badge { display: none; }

    /* tabel di dalam kartu -> geser horizontal */
    .card-body > .table,
    .card-body > form + .table { display: block; }
    .card-body:has(> .table),
    .card-body > div[style*="overflow"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 520px; }
    .table.no-min { min-width: 0; }

    /* board kelompok: satu kolom penuh */
    .kelompok-col { max-width: 100% !important; flex-basis: 100% !important; }
    .display-6 { font-size: 2rem; }
}
