/* ==========================================================================
   Alamat Pegawai PLN — mobile-first
   ========================================================================== */

:root {
    --blue-900: #071c3f;
    --blue-800: #0a2a5e;
    --blue-700: #0e3f7c;
    --blue-500: #1565c0;
    --blue-100: #e4edf9;
    --yellow: #ffc72c;
    --yellow-ink: #5c4400;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #142433;
    --text-muted: #5b6b7c;
    --border: #dbe4ee;
    --success: #1e8e5a;
    --success-bg: #e7f6ee;
    --danger: #d64545;
    --danger-bg: #fdeaea;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(7, 28, 63, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3, .brand-name {
    font-family: 'Poppins', 'Inter', sans-serif;
}

a { color: var(--blue-700); }

/* ---- Header ---- */
.topbar {
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand-logo {
    flex-shrink: 0;
}
.brand-logo img {
    display: block;
    height: 40px;
    width: auto;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.brand-sub {
    font-size: 12px;
    color: #c7d7ee;
    margin-top: 1px;
}

.topbar .spacer { flex: 1; }

.topbar-action {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.topbar-action:hover { background: rgba(255,255,255,0.2); }

/* ---- Layout ---- */
.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}
.page.wide { max-width: 1100px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.card h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--blue-900);
}
.card .hint {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- Form ---- */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.field input[type=text],
.field input[type=email],
.field input[type=search],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--blue-500);
    outline-offset: 1px;
    border-color: var(--blue-500);
}
.field textarea { min-height: 90px; resize: vertical; }

.tgl-lahir-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tgl-lahir-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    text-align: center;
}
.tgl-lahir-group input:nth-child(1),
.tgl-lahir-group input:nth-child(3) { flex: 1 1 0; }
.tgl-lahir-group input:nth-child(5) { flex: 1.5 1 0; }

.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--blue-100);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.checkbox-field input { margin-top: 3px; }
.checkbox-field label { font-size: 13px; color: var(--blue-900); }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover { background: var(--blue-800); }
.btn-accent { background: var(--yellow); color: var(--yellow-ink); }
.btn-accent:hover { filter: brightness(0.96); }
.btn-ghost { background: transparent; color: var(--blue-700); border: 1px solid var(--border); }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- Employee summary ---- */
.employee-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--blue-100);
    border-radius: 8px;
    padding: 14px;
}
.employee-summary .name { font-weight: 700; font-size: 16px; color: var(--blue-900); text-transform: uppercase; }
.employee-summary .meta { font-size: 13px; color: var(--text-muted); }

/* ---- Map ---- */
.map-box {
    height: 260px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    /* contain Leaflet's internal z-index (panes/controls go up to 1000)
       so it can never paint over the sticky header while scrolling */
    isolation: isolate;
    position: relative;
}
.map-hint { font-size: 12px; color: var(--text-muted); }
.coord-readout { font-size: 12px; color: var(--blue-700); font-weight: 600; margin-top: 4px; }

/* ---- Wizard steps ---- */
.step-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.step-indicator .dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}
.step-indicator .dot.active { background: var(--blue-700); }
.step-indicator .dot.done { background: var(--success); }

.step { display: none; }
.step.active { display: block; }

.child-block {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    position: relative;
}
.child-block .remove-child {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-bg);
    color: var(--danger);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ---- Admin table ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.recap {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
    background: #fff;
}
table.recap th, table.recap td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
table.recap th {
    background: var(--blue-100);
    color: var(--blue-900);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
table.recap td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-done { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--danger-bg); color: var(--danger); }

.login-wrap {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.login-card { width: 100%; max-width: 360px; }

/* ---- Choices.js color override to match brand ---- */
.choices__inner { border-radius: 8px !important; border-color: var(--border) !important; padding: 8px 12px !important; }
.choices__list--dropdown .choices__item--selectable.is-highlighted { background: var(--blue-500) !important; }
.choices__list--dropdown .choices__item { white-space: nowrap !important; }
.choices__list--dropdown { width: max-content; max-width: 90vw; }
.choices[data-type*=select-one] .choices__input { padding: 8px !important; }

/* ---- Responsive: tablet+ ---- */
@media (min-width: 640px) {
    .field-row { grid-template-columns: 1fr 1fr; }
    .btn-row .btn { width: auto; }
    .btn { width: auto; }
    .btn-row.stack-mobile-only { display: flex; }
}

@media (min-width: 900px) {
    .page { padding: 28px 16px; }
    .card { padding: 26px; }
    table.recap th, table.recap td { padding: 14px 18px; }
}
