
:root {
    --teal: #0f766e;
    --teal-dark: #115e59;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #cbd5e1;
    --bg: #f1f5f9;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    line-height: 1.5;
}

img {
    max-width: 100%;
}

a {
    color: var(--teal);
}

/* =========================
   HEADER / HERO
========================= */

.hero {
    background: linear-gradient(130deg, #115e59, #0f766e);
    color: white;
    text-align: center;
    padding: 34px 16px;
}

.hero h1 {
    font-size: clamp(24px, 4vw, 36px);
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.hero p {
    margin: 0;
}

.brand {
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 13px;
}

.brand.dark {
    color: var(--teal);
}

/* Identitas sekolah */

.school-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.school-logo {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.school-brand h1 {
    margin: 5px 0;
    overflow-wrap: anywhere;
}

/* =========================
   CONTAINER / CARD
========================= */

.container {
    width: 100%;
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 14px 30px;
}

.container.wide {
    max-width: 1400px;
}

.container.narrow {
    max-width: 500px;
    margin-top: 45px;
}

.card {
    min-width: 0;
    background: white;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 3px 14px #0f172a0a;
}

.card h2 {
    color: var(--teal);
    font-size: 19px;
    margin: 0 0 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    overflow-wrap: anywhere;
}

/* =========================
   FORM / INPUT
========================= */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    min-width: 0;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin: 12px 0 6px;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    font: inherit;
    color: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #99f6e4;
    border-color: var(--teal);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    display: inline-block;
}

input[type="file"] {
    max-width: 100%;
    padding: 9px;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

small,
.small {
    font-size: 12px;
    color: var(--muted);
}

/* =========================
   BUTTON
========================= */

.button,
button.button {
    display: inline-block;
    max-width: 100%;
    border: 0;
    background: var(--teal);
    color: white;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 7px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.button:hover {
    background: var(--teal-dark);
}

.button.secondary {
    background: #e2e8f0;
    color: var(--ink);
}

.button.whatsapp {
    background: #166534;
}

.button.smallbtn {
    padding: 7px 10px;
    font-size: 13px;
}

form .button {
    margin-top: 16px;
}

/* =========================
   NOTICE / ALERT
========================= */

.notice {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert {
    background: #fef2f2;
    color: #991b1b;
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.center {
    text-align: center;
}

.muted {
    color: var(--muted);
}

.success-mark {
    font-size: 50px;
    color: var(--teal);
}

.required {
    color: #dc2626;
}

.photo-error {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

/* =========================
   NOMOR PENDAFTARAN
========================= */

.registration-number {
    padding: 16px;
    border: 1px dashed var(--teal);
    border-radius: 9px;
    font-size: 25px;
    font-weight: bold;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 18px 0;
}

/* =========================
   ADMIN TOPBAR
========================= */

.topbar {
    background: var(--teal-dark);
    color: white;
    padding: 16px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar a {
    color: white;
    margin-left: 16px;
}

/* =========================
   DASHBOARD STATISTIK
========================= */

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.stat {
    min-width: 0;
    background: white;
    border-radius: 10px;
    padding: 17px;
    box-shadow: 0 3px 12px #0f172a08;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    display: block;
    font-size: 28px;
    color: var(--teal);
    margin-top: 6px;
    overflow-wrap: anywhere;
}

/* =========================
   FILTER / TABEL
========================= */

.filters {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.filters input {
    flex: 1 1 200px;
    min-width: 0;
}

.filters select {
    width: auto;
    min-width: 160px;
    max-width: 100%;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: left;
    padding: 11px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    vertical-align: top;
}

thead th {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    border-radius: 99px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: bold;
}

.badge.lulus {
    background: #dcfce7;
    color: #166534;
}

.badge.tidak-lulus {
    background: #fee2e2;
    color: #991b1b;
}

.badge.cadangan {
    background: #fef3c7;
    color: #92400e;
}

.badge.menunggu {
    background: #dbeafe;
    color: #1d4ed8;
}

/* =========================
   PAGINATION / ACTIONS
========================= */

.pagination,
.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.actions {
    justify-content: flex-start;
}



/* =========================
   FOTO SISWA 4x6 - FIX HP
========================= */

.photo-upload-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.photo-preview-wrap {
    width: 150px;
    max-width: 100%;
    flex: 0 0 150px;
    min-width: 0;
}

/* Pastikan elemen hidden benar-benar tidak tampil */
.photo-preview[hidden],
.photo-placeholder[hidden] {
    display: none !important;
}

/* Foto yang diunggah */
.photo-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    object-position: center;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

/* Bingkai petunjuk foto */
.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    box-sizing: border-box;
    padding: 12px;
    border: 1px dashed var(--teal);
    border-radius: 7px;
    background: #fff;
    color: var(--teal-dark);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.photo-upload-layout .field {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
}

.photo-upload-layout input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.photo-upload-layout small {
    display: block;
    margin-top: 8px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.photo-error {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

/* =========================
   TAMPILAN HP
========================= */

@media (max-width: 620px) {
    .photo-upload-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        width: 100%;
    }

    .photo-preview-wrap {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .photo-preview,
    .photo-placeholder {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .photo-preview {
        object-fit: contain;
    }

    .photo-upload-layout .field {
        width: 100%;
        flex: none;
    }

    .photo-upload-layout input[type="file"] {
        width: 100%;
        font-size: 14px;
    }
}


/* =========================
   RESPONSIF TABLET
========================= */

@media (max-width: 850px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================
   RESPONSIF HP
========================= */

@media (max-width: 620px) {
    body {
        overflow-wrap: break-word;
    }

    .container {
        width: 100%;
        margin: 16px auto;
        padding: 0 10px 24px;
    }

    .container.narrow {
        margin-top: 18px;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .field,
    .field.full {
        grid-column: auto;
        width: 100%;
    }

    .card {
        width: 100%;
        padding: 14px;
        border-radius: 10px;
    }

    .card h2 {
        font-size: 18px;
    }

    .hero {
        padding: 22px 12px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .school-brand {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 10px;
        text-align: left;
        width: 100%;
    }

    .school-logo,
    .logo-placeholder {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .school-brand h1 {
        font-size: 21px;
    }

    .school-brand .brand {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .photo-upload-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.photo-preview-wrap {
    width: 100%;
    max-width: 100%;
    flex: none;
    min-width: 0;
}

    .photo-preview,
    .photo-placeholder {
        width: 80px;
        height: 120px;
        max-width: 100%;
    }

    .photo-placeholder {
        border: 1px dashed var(--teal);
        background: #fff;
        color: var(--teal-dark);
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    input[type="file"] {
        width: 100%;
        min-width: 0;
        font-size: 13px;
        padding: 8px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .stat {
        padding: 12px;
    }

    .stat strong {
        font-size: 23px;
    }

    .registration-number {
        font-size: 20px;
        padding: 12px;
    }

    .topbar {
        padding: 14px;
        gap: 8px;
    }

    .topbar a {
        margin-left: 0;
        margin-right: 10px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters input,
    .filters select {
        width: 100%;
        min-width: 0;
    }

    .pagination,
    .actions {
        justify-content: flex-start;
    }

    .button,
    button.button {
        max-width: 100%;
    }
}

/* =========================
   HP SANGAT KECIL
========================= */

@media (max-width: 360px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .card {
        padding: 12px;
    }

    .school-brand {
        gap: 8px;
    }

    .school-brand h1 {
        font-size: 18px;
    }

    .stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .registration-number {
        font-size: 18px;
    }
}

/* =========================
   CETAK
========================= */

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .no-print,
    .topbar,
    .button {
        display: none !important;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 0;
        padding: 0;
    }

    .photo-placeholder {
        background: #fff;
        color: var(--teal-dark);
    }
}
