:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #16202a;
    --muted: #607284;
    --brand: #005d74;
    --brand-accent: #0b8ea8;
    --danger: #b42318;
    --ok: #117a38;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #d4eef4 0%, var(--bg) 40%);
}

.container {
    width: min(960px, 92%);
    margin: 0 auto;
}

.hero {
    padding: 36px 0 20px;
}

.hero h1 {
    margin: 0 0 8px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 24px 0 40px;
}

@media (min-width: 900px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(22, 32, 42, 0.07);
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.count-box {
    text-align: center;
    background: #eff9fc;
    border: 1px solid #d6eef4;
    border-radius: 12px;
    padding: 12px 8px;
}

.count-box strong {
    display: block;
    font-size: 1.4rem;
    color: var(--brand);
}

.count-box span {
    color: var(--muted);
    font-size: 0.9rem;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
button,
textarea {
    width: 100%;
    border: 1px solid #cad5de;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

button,
.btn {
    border: 0;
    background: linear-gradient(120deg, var(--brand), var(--brand-accent));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-danger {
    background: linear-gradient(120deg, #b42318, #d92d20);
}

.btn-primary {
    background: linear-gradient(120deg, #005d74, #0b8ea8);
}

.btn-secondary {
    background: linear-gradient(120deg, #64748b, #94a3b8);
}

.btn-info {
    background: linear-gradient(120deg, #0891b2, #06b6d4);
}

.btn-purple {
    background: linear-gradient(120deg, #7c3aed, #a78bfa);
}

.btn-warning {
    background: linear-gradient(120deg, #d97706, #f59e0b);
}

.btn-unlock {
    background: #005f02;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-width: auto;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-action {
    min-width: 92px;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.88rem;
    line-height: 1;
}

.cell-actions {
    white-space: nowrap;
}

.btn-edit {
    background: linear-gradient(120deg, #0f5d7a, #138aa8);
}

.icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex: 0 0 14px;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.bulk-actions button {
    width: auto;
}

.bulk-actions .btn-set-lulus {
    background: #237227;
    transition: background-color 0.2s ease, filter 0.2s ease;
}

.bulk-actions .btn-set-tidak-lulus {
    background: #c00707;
    transition: background-color 0.2s ease, filter 0.2s ease;
}

.bulk-actions .btn-set-lulus:hover {
    background: #1d6121;
    filter: none;
}

.bulk-actions .btn-set-tidak-lulus:hover {
    background: #a80606;
    filter: none;
}

.toolbar-search button,
.toolbar-actions .btn,
.bulk-actions button,
.bulk-actions .btn {
    height: 42px;
    min-height: 42px;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

.toolbar-search input,
.toolbar-search select {
    height: 42px;
}

.import-preview-actions button,
.import-preview-actions .btn {
    flex: 1 1 0;
}

.btn-import-save {
    background: linear-gradient(120deg, #0f766e, #14b8a6);
}

.btn-import-select-all {
    background: linear-gradient(120deg, #1d4ed8, #3b82f6);
}

.btn-import-clear-all {
    background: linear-gradient(120deg, #9a3412, #ea580c);
}

@media (max-width: 768px) {
    .toolbar-actions,
    .bulk-actions {
        gap: 8px;
    }

    .toolbar-actions .btn,
    .bulk-actions button,
    .bulk-actions .btn {
        flex: 1 1 auto;
    }
}

button:hover,
.btn:hover {
    filter: brightness(1.04);
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.alert-success {
    background: #edfdf3;
    border: 1px solid #c8f3d6;
    color: var(--ok);
}

.alert-danger {
    background: #fff2f1;
    border: 1px solid #ffd6d3;
    color: var(--danger);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.nav > strong {
    line-height: 1.25;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links .btn {
    height: 38px;
    min-height: 38px;
    width: auto;
    min-width: 112px;
    padding: 0 14px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .nav > strong {
        text-align: center;
        font-size: 1.05rem;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .nav-links .btn {
        width: 100%;
        min-width: 0;
        height: 40px;
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.86rem;
    }
}

@media (max-width: 460px) {
    .nav-links {
        grid-template-columns: 1fr;
    }
}

.nav-btn-dashboard {
    background: linear-gradient(120deg, #0d6b8a, #1082a4);
}

.nav-btn-import {
    background: linear-gradient(120deg, #225b9c, #2f74bf);
}

.nav-btn-students {
    background: linear-gradient(120deg, #2a7b3f, #3f9f58);
}

.nav-btn-setting {
    background: linear-gradient(120deg, #7a4b18, #a56721);
}

.nav-btn-logout {
    background: linear-gradient(120deg, #a11212, #d11b1b);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5ebf0;
    text-align: left;
    padding: 10px;
    font-size: 0.92rem;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-success {
    background: #e9fce9;
    color: #1d7a35;
}

.badge-danger {
    background: #ffeded;
    color: #9d2424;
}

.footer {
    color: var(--muted);
    font-size: 0.85rem;
    padding: 8px 0 22px;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.app-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f5d7a;
    background: linear-gradient(120deg, #e6f6fb, #edf8ff);
    border: 1px solid #cde7f0;
}

.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    color: #0f5d7a;
    font-weight: 700;
}

.pagination-links .btn,
.pagination-links .pagination-current {
    background: transparent;
    border: 0;
    color: #0f5d7a;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0 2px;
    border-radius: 0;
    font-weight: 700;
    text-decoration: none;
}

.pagination-links .btn:hover {
    background: transparent;
    filter: none;
    text-decoration: underline;
}

.dashboard-per-page-form .btn {
    width: auto;
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dashboard-stat-card {
    border: 1px solid #d8e5ec;
    text-align: center;
}

.dashboard-stat-card h3 {
    margin: 0;
}

.stat-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stat-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d8e5ec;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 15px;
    height: 15px;
    fill: #0f5d7a;
}

.dashboard-stat-card.stat-total {
    background: linear-gradient(135deg, #ffffff 0%, #e8f6fb 100%);
}

.dashboard-stat-card.stat-lulus {
    background: linear-gradient(135deg, #ffffff 0%, #e9f8ee 100%);
}

.dashboard-stat-card.stat-tidak-lulus {
    background: linear-gradient(135deg, #ffffff 0%, #fff0ed 100%);
}

.dashboard-stat-card.stat-info {
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}

.school-logo-frame {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    border: 1px solid #d9e4ea;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.public-page {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(circle at 10% 0%, #d6edf5 0%, rgba(214, 237, 245, 0) 40%),
        radial-gradient(circle at 90% 15%, #e6f8ea 0%, rgba(230, 248, 234, 0) 34%),
        #edf3f6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-page .container {
    width: min(1080px, 92%);
    padding: 24px 0;
}

.public-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.public-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.public-logo {
    width: 78px;
    height: 78px;
    border-radius: 18px;
}

.public-page h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    color: #0a5568;
}

.public-subtitle {
    margin: 6px 0 4px;
    color: #25566a;
    font-weight: 700;
}

.public-address {
    margin: 0;
    color: #607284;
    font-size: 0.93rem;
}

.public-pill {
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pill-success {
    background: #dbf6e3;
    color: #16743b;
}

.pill-danger {
    background: #ffe3e0;
    color: #b42318;
}

.public-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 18px 0 30px;
}

.public-grid-single {
    grid-template-columns: 1fr;
}

.public-card {
    border: 1px solid #d9e6ec;
    box-shadow: 0 18px 30px rgba(13, 63, 78, 0.08);
}

.public-card-highlight {
    border: 1px solid #bedbe5;
    background: linear-gradient(180deg, #ffffff 0%, #f6fcff 100%);
}

.public-muted {
    margin-top: -2px;
    color: #607284;
    font-size: 0.9rem;
}

.public-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.public-footer small {
    color: #607284;
    font-size: 0.9rem;
}

.public-footer .btn {
    height: 38px;
    min-height: 38px;
    width: auto;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.public-footer .app-footer-meta {
    justify-content: flex-end;
}

.public-footer .app-version-badge {
    background: linear-gradient(120deg, #e6f6fb, #edf8ff);
    border: 1px solid #cde7f0;
}

.lock-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #ffd9d5;
    background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.lock-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffd9d5;
    flex: 0 0 64px;
}

.lock-icon {
    width: 34px;
    height: 34px;
    fill: #b42318;
}

.lock-title {
    margin: 0 0 4px;
    color: #8f1a1a;
}

.lock-text {
    margin: 0;
    color: #7f3a3a;
}

@media (max-width: 860px) {
    .public-page {
        align-items: flex-start;
    }

    .public-page .container {
        padding-top: 20px;
    }

    .public-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .public-grid {
        grid-template-columns: 1fr;
    }
}

.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 27, 35, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.confirm-modal.is-open {
    display: flex;
}

.confirm-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #d9e6ec;
    box-shadow: 0 24px 48px rgba(16, 27, 35, 0.2);
}

.confirm-dialog h3 {
    margin: 0 0 8px;
}

.confirm-dialog p {
    margin: 0;
    color: #5f7284;
}

.confirm-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.login-logo {
    width: 54px;
    height: 54px;
    border-radius: 12px;
}

.login-school-name {
    margin: 0;
    font-weight: 700;
    color: #25566a;
}

.result-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-container {
    width: min(900px, 92%);
}

.result-card {
    max-width: 700px;
    margin: 0 auto;
}

.result-hero {
    text-align: center;
}

.result-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.result-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.status-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-icon-lulus {
    width: 18px;
    height: 18px;
    fill: #1d7a35;
}

.result-actions .btn {
    width: auto;
    min-width: 180px;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-result-pdf {
    background: linear-gradient(120deg, #0d6b8a, #1082a4);
}

.btn-result-back {
    background: linear-gradient(120deg, #5d4d18, #7a6522);
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-login-page .login-wrapper {
    width: min(500px, 92%);
}

.login-back-wrap {
    margin-top: 12px;
}

.btn-back-public {
    background: transparent;
    color: #111111;
    border: 0;
    padding: 0;
    height: auto;
    min-height: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-back-public:hover {
    background: transparent;
    color: #000000;
    filter: none;
}

.back-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .admin-login-page {
        align-items: flex-start;
        padding-top: 20px;
    }

    .btn-back-public {
        width: auto;
    }

    .result-page {
        align-items: flex-start;
        padding-top: 20px;
    }

    .result-actions .btn {
        flex: 1 1 100%;
    }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 6px;
}

.password-strength-bar {
    width: 100%;
    height: 6px;
    background-color: #e5ebf0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.password-strength-text {
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}
