/* =====================================================
   style.css
   Base & LAYOUT saja (bukan komponen UI reusable).
   Untuk elemen yang sering dipakai ulang (tombol, tabel,
   modal, badge, toast, dst.) lihat components.css
   ===================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f3f4f6; color: #1f2937; }

/* ---------- Layout dasar ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: #111827;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-brand { padding: 20px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #1f2937; }
.sidebar-nav { display: flex; flex-direction: column; padding: 12px 0; }
.sidebar-nav a { color: #d1d5db; text-decoration: none; padding: 10px 16px; font-size: 14px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #1f2937; color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.btn-logout { color: #dc2626; text-decoration: none; font-weight: 600; }

/* Tombol hamburger — hanya tampil di layar kecil */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #111827;
}

.content { padding: 24px; }
.content h1 { margin-bottom: 16px; font-size: 22px; }

/* ---------- Dashboard cards ---------- */
.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.card { background: #fff; border-radius: 8px; padding: 20px; min-width: 180px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-value { font-size: 28px; font-weight: 700; color: #2563eb; }
.card-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* ---------- Halaman Login ---------- */
.login-body { min-height: 100vh; background: #f5f8ff; color: #1d2939; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
.login-visual { position: relative; overflow: hidden; padding: clamp(32px, 6vw, 72px); color: #fff; background: linear-gradient(145deg, #0d3eac 0%, #165dff 54%, #36cbcb 130%); }
.login-visual::after { content: ''; position: absolute; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; top: 38%; left: 42%; }
.login-visual-glow { position: absolute; border-radius: 999px; filter: blur(4px); opacity: .3; }
.glow-one { width: 380px; height: 380px; background: #74f3ec; top: -170px; right: -90px; }
.glow-two { width: 250px; height: 250px; background: #7ea5ff; bottom: -90px; left: -80px; }
.login-visual-content { position: relative; z-index: 1; min-height: calc(100vh - clamp(64px, 12vw, 144px)); display: flex; flex-direction: column; }
.login-brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; text-decoration: none; font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.login-brand img { width: auto; height: 42px; object-fit: contain; }
.login-brand-light { color: #fff; }
.login-brand-dark { color: #165dff; }
.login-intro { max-width: 560px; margin: auto 0; padding: 72px 0 42px; }
.login-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; opacity: .8; margin-bottom: 18px; }
.login-intro h1 { font-size: clamp(38px, 4.2vw, 60px); line-height: 1.08; letter-spacing: -1.8px; }
.login-intro p:not(.login-eyebrow) { max-width: 470px; margin-top: 22px; font-size: 17px; line-height: 1.7; color: rgba(255,255,255,.86); }
.login-feature { display: flex; align-items: center; gap: 11px; width: fit-content; padding: 12px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); font-size: 14px; }
.login-feature-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #fff; color: #165dff; font-weight: 800; }
.login-panel { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-card { width: min(100%, 400px); }
.login-panel .login-brand { margin-bottom: 52px; }
.login-heading h2 { font-size: 31px; letter-spacing: -.8px; }
.login-heading p { margin-top: 10px; color: #667085; line-height: 1.5; }
.login-form { margin-top: 30px; }
.login-field + .login-field { margin-top: 20px; }
.login-field label { display: block; margin-bottom: 8px; color: #344054; font-size: 14px; font-weight: 700; }
.login-form .form-control { height: 48px; margin: 0; padding: 0 14px; border: 1px solid #d8e0ed; border-radius: 10px; color: #1d2939; box-shadow: none; transition: border-color .2s, box-shadow .2s; }
.login-form .form-control::placeholder { color: #98a2b3; }
.login-form .form-control:focus { border-color: #165dff; box-shadow: 0 0 0 4px rgba(22,93,255,.12); }
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 52px; }
.password-toggle { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #667085; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { background: #f2f6ff; color: #165dff; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; margin-top: 28px; border-radius: 10px; background: #165dff; box-shadow: 0 10px 20px rgba(22,93,255,.2); transition: transform .2s, background .2s, box-shadow .2s; }
.login-submit:hover { background: #0f4ed9; box-shadow: 0 13px 24px rgba(22,93,255,.28); transform: translateY(-1px); }
.login-submit span { font-size: 20px; line-height: 1; }
.login-footer { margin-top: 32px; text-align: center; color: #98a2b3; font-size: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-top: 22px; }
.alert-error { background: #fff0f0; color: #c52d2d; border: 1px solid #ffd0d0; }

@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }
    .login-visual { min-height: 260px; padding: 28px 32px; }
    .login-visual-content { min-height: auto; }
    .login-intro { margin: 44px 0 0; padding: 0; }
    .login-intro h1 { font-size: clamp(30px, 7vw, 42px); max-width: 620px; }
    .login-intro p:not(.login-eyebrow), .login-feature { display: none; }
    .login-panel { min-height: calc(100vh - 260px); }
}

@media (max-width: 480px) {
    .login-visual { min-height: 210px; padding: 24px; }
    .login-brand { font-size: 22px; }
    .login-brand img { height: 36px; }
    .login-intro { margin-top: 34px; }
    .login-panel { min-height: calc(100vh - 210px); padding: 34px 24px; }
    .login-panel .login-brand { margin-bottom: 38px; }
    .login-heading h2 { font-size: 28px; }
}

/* =====================================================
   RESPONSIVE — breakpoint tablet & mobile
   ===================================================== */
@media (max-width: 768px) {
    .sidebar-toggle { display: block; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.sidebar-open { transform: translateX(0); }

    /* Overlay gelap saat sidebar terbuka di mobile */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 55;
    }
    .sidebar-backdrop.show { display: block; }

    .content { padding: 16px; }
    .cards { flex-direction: column; }
    .card { min-width: 0; }
}

/* Penyederhanaan layout login: satu kartu fokus agar konsisten di semua ukuran layar. */
.login-page { display: block; }
.login-visual { display: none; }
.login-panel { min-height: 100vh; padding: 24px; background:
    radial-gradient(circle at 12% 12%, rgba(54,203,203,.22), transparent 30%),
    radial-gradient(circle at 88% 85%, rgba(22,93,255,.2), transparent 32%),
    #f5f8ff; }
.login-card { padding: 42px; border: 1px solid rgba(22,93,255,.1); border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(23,49,99,.14); }
.login-panel .login-brand { justify-content: center; width: 100%; margin-bottom: 34px; }
.login-heading { text-align: center; }
.login-heading h2 { font-size: 28px; }
.login-heading p { font-size: 14px; }
.login-submit { margin-top: 26px; }

@media (max-width: 480px) {
    .login-panel { padding: 16px; }
    .login-card { padding: 30px 22px; border-radius: 16px; }
    .login-panel .login-brand { margin-bottom: 28px; }
}
