@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ---------- Latar halaman ---------- */
body {
    background: #EAF5F6 !important;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, #cfecef 0, rgba(234, 245, 246, 0) 340px),
        radial-gradient(ellipse 55% 40% at 100% 0%, rgba(0, 140, 145, 0.22), transparent 70%),
        radial-gradient(ellipse 55% 40% at 35% 0%, rgba(32, 196, 199, 0.25), transparent 70%);
}

html::after {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 420px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle, rgba(32, 196, 199, 0.65) 2.2px, transparent 2.8px) 0 0 / 15px 15px;
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 100% 100% at 0 0, #000 20%, transparent 75%);
}

body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 170px;
    z-index: -1;
    pointer-events: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220' preserveAspectRatio='none'><path d='M0 90 C90 40 190 20 270 70 C350 120 500 205 760 220 L0 220 Z' fill='%2320C4C7' fill-opacity='.40'/><path d='M0 130 C100 85 190 70 260 115 C340 165 480 212 760 220 L0 220 Z' fill='%23008C91'/><path d='M0 170 C120 150 250 190 420 205 C520 214 640 220 760 220 L0 220 Z' fill='%23006B70'/><path d='M1440 120 C1340 150 1230 195 1000 220 L1440 220 Z' fill='%23008C91'/><path d='M1440 160 C1350 180 1250 205 1120 220 L1440 220 Z' fill='%23006B70'/></svg>") no-repeat bottom / 100% 170px;
}

/* Foto gedung BBKK di kanan bawah (tidak terpotong) */
html::before {
    content: "";
    position: fixed;
    right: 0;
    bottom: 0;
    width: min(640px, 46vw);
    height: 80vh;
    z-index: -1;
    pointer-events: none;
    background: url("assets/gedung.jpg") no-repeat right bottom / auto 100%;
    opacity: 0.92;
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 40%),
        linear-gradient(180deg, transparent 0%, #000 25%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 40%),
        linear-gradient(180deg, transparent 0%, #000 25%);
    mask-composite: intersect;
}


/* ---------- Font Poppins ---------- */
.tema-main, .tema-main input, .tema-main textarea, .tema-main select, .tema-main button,
.sidebar-drawer, .sidebar-drawer button, .modal-box, .custom-confirm-box {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

.tema-main { max-width: 1020px; margin: 0 auto; padding: 28px 24px 60px; }
.tema-main.lebar { max-width: 1120px; }
.tema-main.ekstra-lebar { max-width: 1450px; }
#halamanPegawai .data-pegawai-table-card { padding-left: 26px !important; padding-right: 26px !important; }

/* ---------- Judul bagian ---------- */
.tema-main .section-title { margin-bottom: 20px; }
.tema-main .section-title span {
    display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px;
    background: rgba(0,140,145,.12); color: #006B70 !important; letter-spacing: 1.5px;
}
.tema-main .section-title h2 { font-size: 24px; font-weight: 700; color: #0B4F62; margin: 8px 0 4px; }
.tema-main .section-title p { color: #4f8a93; font-size: 12.5px; margin: 0; }
.judul-baris { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.judul-baris .section-title { margin-bottom: 0; }

/* ---------- Kartu ---------- */
.tema-main .tema-card, .tema-main .rekap-card, .tema-main .data-pegawai-table-card {
    position: relative; overflow: hidden;
    background: rgba(255,255,255,.90) !important;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.95) !important;
    border-radius: 16px !important;
    padding: 20px 22px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 10px 30px rgba(0,107,112,.12) !important;
}
.tema-main .tema-card::before, .tema-main .rekap-card::before, .tema-main .data-pegawai-table-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
    background: linear-gradient(90deg, #006B70 0%, #008C91 55%, #20C4C7 100%);
}
.card-title { display:flex; align-items:center; gap:12px; margin: 4px 0 16px; }
.card-title .number {
    width:36px; height:36px; display:flex; align-items:center; justify-content:center; flex:none;
    color:#fff; font-size:15px; border-radius:11px;
    background: linear-gradient(135deg, #006B70, #20C4C7); box-shadow: 0 6px 14px rgba(0,140,145,.30);
}
.card-title h3 { font-size: 15.5px; font-weight: 700; color: #0B4F62; margin: 0 0 2px; }
.card-title p { color:#5f959d; font-size: 11.5px; margin: 0; }
.tema-main .data-pegawai-table-card h3 { font-size: 15.5px !important; font-weight: 700; color: #0B4F62; }

/* ---------- Isian ---------- */
.tema-main .form-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tema-main .form-group { display:flex; flex-direction:column; gap:5px; }
.tema-main .form-group label, .tema-main .filter-group label { font-size:12px; font-weight:600; color:#0B4F62; }
.tema-main input, .tema-main select, .tema-main textarea, .tema-main .filter-control {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid #cfe6e8 !important; border-radius: 10px !important;
    padding: 9px 12px !important; font-size: 12.5px !important;
    color: #0B4F62; background: #f9fdfd; outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.tema-main input::placeholder { color:#8fb1b6; }
.tema-main input:hover, .tema-main select:hover { border-color:#8fd3d6 !important; }
.tema-main input:focus, .tema-main select:focus, .tema-main .filter-control:focus {
    background:#fff; border-color:#14B0B5 !important; box-shadow: 0 0 0 4px rgba(32,196,199,.18) !important;
}
.tema-main input[readonly] { background:#eef6f7 !important; color:#5f959d; }
.tema-main #searchPegawai { width: 300px; max-width: 100%; }

/* ---------- Tombol ---------- */
.aksi-form { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.tema-main #btnBatalEdit, .tema-main #btnSimpanPegawai {
    border:none; border-radius:10px; padding:10px 22px; font-size:13px; font-weight:700;
    color:#fff; cursor:pointer; text-shadow:0 1px 2px rgba(0,0,0,.25);
    transition: transform .2s, filter .2s;
}
.tema-main #btnBatalEdit { background: linear-gradient(135deg,#ff5a5a,#e63535); box-shadow:0 6px 14px rgba(230,53,53,.28); }
.tema-main #btnSimpanPegawai { background: linear-gradient(135deg,#005a5f,#008C91); box-shadow:0 6px 14px rgba(0,107,112,.34); }
.tema-main #btnBatalEdit:hover, .tema-main #btnSimpanPegawai:hover { transform:translateY(-2px); filter:brightness(1.06); }

.btn-kembali-pill, #btnKembaliHalaman {
    display:inline-flex !important; align-items:center; gap:8px; text-decoration:none;
    background: linear-gradient(135deg,#006B70,#008C91 60%,#14B0B5) !important;
    color:#fff !important; border-radius:999px !important; padding:10px 22px !important;
    font-size:13px !important; font-weight:700 !important; border:none !important;
    font-family:'Poppins','Segoe UI',sans-serif !important;
    box-shadow:0 6px 16px rgba(0,107,112,.30) !important;
    transition: transform .2s, filter .2s;
}
.btn-kembali-pill:hover { transform:translateY(-2px); filter:brightness(1.06); }

/* Tab Data Pegawai / Pejabat (warna aktif diatur oleh pegawai.js) */
#btnViewPegawai, #btnViewPejabat {
    border-radius: 999px !important; padding: 9px 20px !important; font-size:12.5px;
    box-shadow: 0 5px 12px rgba(0,107,112,.22); transition: transform .2s, filter .2s;
    font-family:'Poppins','Segoe UI',sans-serif !important;
}
#btnViewPegawai:hover, #btnViewPejabat:hover { transform:translateY(-2px); filter:brightness(1.07); }

.tema-main .btn-action { border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.tema-main .btn-action:hover { transform: translateY(-1px); filter: brightness(1.07); }
.tema-main .btn-open { background: linear-gradient(135deg,#006B70,#008C91); }
.tema-main .btn-edit { background: linear-gradient(135deg,#0e9aa0,#20C4C7); }
.tema-main .btn-delete { background: linear-gradient(135deg,#ff5a5a,#e63535); }
.tema-main .btn-tab-user { border-radius: 999px; font-family:'Poppins','Segoe UI',sans-serif; }
.tema-main .btn-tab-user.active { background: linear-gradient(135deg,#006B70,#008C91); }
.tema-main .badge-total { background: rgba(0,140,145,.12); color:#006B70; }

/* ---------- Tabel ---------- */
.tema-main .rekap-table-wrapper {
    background: rgba(255,255,255,.92); border-radius:16px;
    box-shadow: 0 10px 30px rgba(0,107,112,.12); overflow-x:auto;
}
.tema-main .rekap-table { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tema-main .rekap-table thead, .tema-main .tabel-pejabat thead {
    background: linear-gradient(90deg, #006B70, #008C91 60%, #14B0B5);
}
.tema-main .rekap-table th, .tema-main .tabel-pejabat th,
#tabelMasterPegawaiView thead th, #tabelMasterPegawaiView thead tr {
    background: transparent !important;
    color:#fff !important; font-weight:700; font-size:12.5px !important;
}
#tabelMasterPegawaiView thead { background: linear-gradient(90deg, #006B70, #008C91 60%, #14B0B5); }
.tema-main .rekap-table td { font-size:13px; color:#0B4F62; border-bottom:1px solid #D5EEF0; }
.tema-main .rekap-table tbody tr:hover td { background:#f1f9fa; }
#tabelMasterPegawaiView { border-radius: 12px !important; border:1px solid #D5EEF0 !important; }
#tabelMasterPegawaiView tbody tr:hover td { background:#f1f9fa !important; }
#tabelMasterPegawaiView td:last-child button { border-radius: 8px !important; font-size: 11px !important; color:#fff; }
.tema-main .tabel-pejabat { width:100%; border-collapse: separate; border-spacing:0; font-size:13px; }
.tema-main .tabel-pejabat td { color:#0B4F62; border-bottom:1px solid #D5EEF0; padding:11px 10px; }
.tema-main .tabel-pejabat tbody tr:hover td { background:#f1f9fa; }

/* ---------- Modal ---------- */
.modal-box, .custom-confirm-box { border-radius: 18px !important; border-top: 5px solid #008C91; box-shadow: 0 20px 50px rgba(0,60,68,.30) !important; }
.modal-title, .custom-confirm-box h3 { color:#0B4F62 !important; }
.btn-modal-cancel { background:#D5EEF0 !important; color:#1F5560 !important; border-radius:10px !important; padding:9px 20px !important; }
.btn-modal-confirm { background: linear-gradient(135deg,#ff5a5a,#e63535) !important; border-radius:10px !important; padding:9px 20px !important; }
.custom-confirm-overlay, .modal-overlay { background: rgba(0,60,68,.55) !important; }
.custom-confirm-buttons button { border-radius:10px !important; }

/* ---------- Responsif ---------- */
@media (max-width: 800px) {
    html::before { opacity:.35; width:70vw; }
    .tema-main { padding: 28px 14px 50px; }
    .tema-main .form-grid { grid-template-columns: 1fr; }
}
@media print {
    html::before, html::after, body::before, body::after { display:none !important; }
    body { background:#fff !important; }
}

/* Tombol Kembali otomatis: di kanan atas, ikut bergulir bersama halaman */
#btnKembaliHalaman {
    position: absolute !important;
    top: 118px !important;
    right: 28px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 998 !important;
    height: 40px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    white-space: nowrap;
}
@media (max-width: 800px) { #btnKembaliHalaman { right: 14px !important; height: 36px !important; font-size: 12px !important; } }
@media print { #btnKembaliHalaman { display: none !important; } }

/* Tulisan tombol aksi selalu putih (termasuk Hapus) */
.tema-main .btn-action, .tema-main .btn-open, .tema-main .btn-edit, .tema-main .btn-delete,
.tema-main .btn-action * { color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tema-main .btn-delete { background: linear-gradient(135deg,#e63535,#c92a2a) !important; }

/* Cegah halaman bergeser ke samping */
body { overflow-x: clip; }