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

* {
    font-family: 'Noto Sans Thai', system-ui, sans-serif;
}

.nav-link {
    border-radius: 8px;
    color: #334155;
    padding: 0.55rem 0.8rem;
}

.nav-link:hover {
    background: #eef2ff;
    color: #3730a3;
}

.hero-band {
    background: transparent;
}

.topic-card {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    padding: 1rem;
}

.form-label {
    display: block;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    outline: none;
    padding: 0.7rem 0.85rem;
    width: 100%;
}

.form-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
    left: 0;
    max-height: 280px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 30;
}

.autocomplete-item {
    display: block;
    padding: 0.75rem 0.9rem;
    text-align: left;
    width: 100%;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: #eef2ff;
}

.autocomplete-name {
    color: #0f172a;
    display: block;
    font-weight: 700;
}

.autocomplete-no {
    color: #64748b;
    display: block;
    font-size: 0.82rem;
    margin-top: 0.1rem;
}

.btn-primary,
.btn-secondary {
    border-radius: 8px;
    font-weight: 700;
    padding: 0.72rem 1rem;
}

.btn-primary {
    background: #4338ca;
    color: #fff;
}

.btn-primary:hover {
    background: #3730a3;
}

.btn-secondary {
    background: #eef2ff;
    color: #3730a3;
}

.btn-secondary:hover {
    background: #e0e7ff;
}

.backend-link {
    border-radius: 8px;
    color: #334155;
    display: block;
    padding: 0.75rem 0.85rem;
}

.backend-link:hover {
    background: #f1f5f9;
    color: #3730a3;
}

.stat-card {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    padding: 1.25rem;
}

.stat-card span {
    color: #64748b;
    display: block;
    font-size: 0.9rem;
}

.stat-card strong {
    color: #312e81;
    display: block;
    font-size: 2rem;
    margin-top: 0.35rem;
}

.data-table {
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.table-action {
    background: transparent;
    border: 0;
    color: #4338ca;
    cursor: pointer;
    font-weight: 700;
    margin-right: 0.75rem;
    padding: 0;
}

.status-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-done {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.certificate-preview {
    aspect-ratio: 1488 / 1052;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    max-width: 1488px;
    position: relative;
    width: 100%;
    container-type: inline-size;
}

.cert-name,
.cert-number {
    position: absolute;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.cert-name {
    color: #312e81;
    font-size: clamp(20px, 2.82cqw, 42px);
    font-weight: 700;
    text-align: center;
}

.cert-number {
    color: #334155;
    font-size: clamp(10px, 1.14cqw, 17px);
    font-weight: 600;
}

@media print {
    header,
    footer,
    button,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

    body,
    main,
    section {
        background: #fff !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .certificate-preview {
        width: 100vw;
    }
}
