@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:  #1e3a6e;
    --green: #00b894;
    --green-dark: #009e7d;
    --red:   #e74c3c;
    --bg:    #f0f2f5;
    --white: #ffffff;
    --border:#dde3ec;
    --text:  #2d3748;
    --muted: #718096;
    --light: #eaf6f3;
}

html { font-size: 15px; }

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px 60px;
}

/* ── CARD ── */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,.09);
    width: 100%;
    max-width: 680px;
    overflow: hidden;
}

/* ── HEADER ── */
.card-header {
    padding: 28px 36px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 18px;
}

.logo-img {
    height: 60px;
    object-fit: contain;
}

.logo-placeholder {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1.5px dashed var(--border);
    border-radius: 6px;
    padding: 0 14px;
    min-width: 90px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    line-height: 1.2;
}

.syarat-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--red);
    font-weight: 600;
}

/* ── BODY ── */
.card-body {
    padding: 24px 36px 32px;
}

/* ── FIELD ── */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field-input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    background: #fdfdfd;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    letter-spacing: 0.5px;
    -webkit-appearance: none;
    text-transform: uppercase;
}

.field-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0,184,148,.12);
}

.field-input::placeholder { color: #b0bec5; }

.field-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 24px;
}

.field-row .field-wrap { flex: 1; }

/* ── SECTION TITLE ── */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

/* ── TABLE ── */
.table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 20px;
}

.anak-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.anak-table thead tr {
    background: var(--navy);
}

.anak-table thead th {
    padding: 11px 14px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.anak-table thead th:last-child { text-align: center; }

.anak-table tbody tr { border-bottom: 1px solid var(--border); }
.anak-table tbody tr:last-child { border-bottom: none; }
.anak-table tbody tr:nth-child(even) { background: #f8fafb; }
.anak-table tbody tr:hover { background: #eef5ff; }

.anak-table td {
    padding: 11px 14px;
    vertical-align: middle;
    color: var(--text);
}

.anak-table td:last-child { text-align: center; }

/*.td-mykid { font-family: 'Courier New', monospace; font-size: 13px; }*/

.empty-row td {
    padding: 22px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-green { background: #d4f5ec; color: #00796b; }
.badge-amber { background: #fff3cd; color: #856404; }

/* ── ALERTS ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-info    { background: var(--light); color: #006d5b; border: 1px solid #a8e6d8; }
.alert-error   { background: #fdf0ef; color: var(--red); border: 1px solid #f5c6c2; }
.alert-success { background: #edfaf5; color: #1a7a56; border: 1px solid #a3e4c7; }
.alert-warn    { background: #fffbe6; color: #856404; border: 1px solid #ffe58f; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-green:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { opacity: 0.85; }

.btn-outline {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    padding: 8px 18px;
    font-size: 13px;
}

.btn-outline:hover { border-color: #aab; color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.btn-check {
    padding: 10px 18px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── KUOTA INFO ── */
.kuota-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--muted);
}

.kuota-row strong { color: var(--text); }

.kuota-icon { font-size: 14px; }

/* ── MODAL OVERLAY ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    overflow: hidden;
    animation: popIn .2s ease;
}

@keyframes popIn {
    from { opacity:0; transform:scale(.95); }
    to   { opacity:1; transform:scale(1); }
}

.modal-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
    padding: 2px 6px;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 22px 24px; }

.modal-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.umur-hint {
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 5px;
    margin-top: 6px;
    display: none;
}

.umur-ok    { background: #edfaf5; color: #1a7a56; border: 1px solid #a3e4c7; }
.umur-tidak { background: #fdf0ef; color: var(--red); border: 1px solid #f5c6c2; }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
    body { padding: 16px 10px 50px; }
    .card-header, .card-body { padding-left: 18px; padding-right: 18px; }
    .page-title { font-size: 20px; }
    .logos { gap: 16px; }
    .logo-img, .logo-placeholder { height: 46px; }
    .anak-table thead th, .anak-table td { padding: 9px 10px; font-size: 12px; }
}

/* ── EXTRA STYLES ── */
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.badge-red {
    background: #fdf0ef;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.td-na { color: #c0bfbc; font-size: 13px; }

.btn-xs {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* Modal large */
.modal-lg { max-width: 640px; }

.modal-scroll {
    max-height: 60vh;
    overflow-y: auto;
}

/* Form grid inside modal */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

.form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding-bottom: 6px;
    margin-bottom: 14px;
}

.field-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.field-hint-sm {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    display: block;
}

.req { color: var(--red); }

@media (max-width: 480px) {
    .form-grid { grid-template-columns: 1fr; }
    .fg-full { grid-column: 1; }
    .modal-lg { max-width: 100%; }
    .action-row { flex-direction: column; }
}

/* ── TADIKA TABLE — NO HORIZONTAL SCROLL ── */
#tadika-table-wrap {
    overflow-x: hidden;
}

#tadika-table-wrap .anak-table {
    table-layout: fixed;
    width: 100%;
}

#tadika-table-wrap .anak-table thead th:nth-child(1) { width: 42px; }
#tadika-table-wrap .anak-table thead th:nth-child(2) { width: 88px; }
#tadika-table-wrap .anak-table thead th:nth-child(3) { width: 22%; }
#tadika-table-wrap .anak-table thead th:nth-child(4) { width: 88px; }
#tadika-table-wrap .anak-table thead th:nth-child(5) { width: auto; }

/* ── TADIKA TABLE — UNIFORM TEXT, UPPERCASE, NO STATUS ── */
#tadika-table-wrap td {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
}

/* ── TADIKA TOOLBAR ── */
.tadika-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tadika-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.tadika-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #a0aec0;
    pointer-events: none;
}

.tadika-search-input {
    display: block;
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: #fdfdfd;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tadika-search-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0,184,148,.12);
}

.tadika-count {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.tadika-count span {
    font-weight: 700;
    color: var(--navy);
}

/* ── TADIKA TABLE OVERRIDE ── */
.tadika-table td:first-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tadika-table td.td-kod {
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--navy);
}

.tadika-table td.td-nama {
    font-weight: 700;
    color: var(--text);
    min-width: 0;
}

.tadika-table td.td-dun {
    font-size: 12.5px;
    color: var(--text);
}

.tadika-table td.td-alamat {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.5;
}

/* ── LOADING SPINNER ── */
.tadika-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 14px;
    color: var(--muted);
    font-size: 13px;
}

.tadika-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.tadika-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 14px;
}

.tadika-empty .sp-icon { font-size: 36px; opacity: 0.3; }
.tadika-empty p { font-size: 13.5px; color: var(--muted); }

/* ── HIGHLIGHT SEARCH MATCH ── */
mark.hl {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* ── PAGINATION ── */
.pagi-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 18px 0 8px;
    flex-wrap: wrap;
}

.pagi-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.pagi-btn:hover:not(:disabled):not(.pagi-active) {
    border-color: var(--navy);
    color: var(--navy);
    background: #eef2ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(30,58,110,0.12);
}

.pagi-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.pagi-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

.pagi-btn.pagi-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    cursor: default;
    box-shadow: 0 3px 10px rgba(30,58,110,0.28);
    transform: translateY(-1px);
}

.pagi-arrow {
    font-size: 15px;
    padding: 0 12px;
}

.pagi-ellipsis {
    font-size: 14px;
    color: var(--muted);
    padding: 0 4px;
    line-height: 36px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ── SYARAT KELAYAKAN ── */
.syarat-wrap {
    padding: 4px 0 8px;
}

.syarat-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbe6;
    border: 1.5px solid #ffe58f;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #856404;
    margin-bottom: 22px;
}

.syarat-alert-icon {
    font-size: 17px;
    flex-shrink: 0;
}

.syarat-list {
    list-style: none;
    counter-reset: syarat-counter;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
}

.syarat-list > li {
    counter-increment: syarat-counter;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.syarat-list > li:last-child {
    border-bottom: none;
}

.syarat-list > li::before {
    content: counter(syarat-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 1px;
}

.syarat-item {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    flex: 1;
}

.syarat-item strong {
    color: var(--navy);
}

.syarat-sub {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.syarat-sub li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.6;
}

.syarat-sub li::before {
    content: '';
    display: block;
    min-width: 7px;
    height: 7px;
    border: 2px solid var(--navy);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}