@font-face {
    font-family: "PTT45Pride";
    src: url("../fonts/ptt45pride/ptt45pride-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "PTT45Pride";
    src: url("../fonts/ptt45pride/ptt45pride-bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #17324d;
    --muted: #64748b;
    --line: #dce7ef;
    --surface: #ffffff;
    --background: #f1f6f9;
    --ptt-gradient: linear-gradient(90deg, #27ffd9, #27a2d9, #00aeef, #0080b7);
    --ptt-dark-blue: #1b1464;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --ok: #067647;
    --ok-bg: #ecfdf3;
    --font: "PTT45Pride", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
}

button, input, select { font: inherit; }
code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.88em;
    background: #eef4f8;
    padding: 1px 5px;
    border-radius: 4px;
}
.muted { color: var(--muted); font-size: 13px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary { background: var(--ptt-dark-blue); color: #fff; }
.btn-primary:hover { background: #2a2190; }
.btn-secondary { background: #fff; color: var(--ptt-dark-blue); border-color: var(--ptt-dark-blue); }
.btn-secondary:hover { background: #f0efff; }
.btn-ghost { background: rgb(255 255 255 / 35%); color: var(--ptt-dark-blue); border-color: rgb(27 20 100 / 25%); }
.btn-ghost:hover { background: rgb(255 255 255 / 60%); }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible { outline: 3px solid #00aeef; outline-offset: 2px; }

/* Alerts */
.alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 1px solid;
}
.alert ul { margin: 6px 0 0; padding-left: 20px; max-height: 320px; overflow: auto; }
.alert-error { background: var(--danger-bg); border-color: #fecdca; color: var(--danger); }
.alert-success { background: var(--ok-bg); border-color: #abefc6; color: var(--ok); }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: var(--ptt-gradient);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 12px 40px rgb(15 45 73 / 25%);
}
.login-logo { width: auto; height: 44px; margin-bottom: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--ptt-dark-blue); }
.login-card .muted { margin: 0 0 20px; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { font-size: 13px; font-weight: 700; margin-top: 8px; }
.login-card input {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfd;
}
.login-card button { margin-top: 18px; }
.back-link { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13px; }

/* Import page */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: var(--ptt-gradient);
    color: var(--ptt-dark-blue);
    box-shadow: 0 4px 20px rgb(15 45 73 / 18%);
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: auto; height: 38px; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 20px; }
.brand small { font-size: 12px; }
.header-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-user form { margin: 0; }
.user-name { font-weight: 700; font-size: 14px; }

.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; color: var(--ptt-dark-blue); }
.card h3 { margin: 22px 0 10px; font-size: 15px; }
.steps { margin: 0 0 16px; padding-left: 22px; }
.steps li { margin-bottom: 4px; }
.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px dashed #9db4c6;
    border-radius: 10px;
    background: #f8fbfd;
}
.upload-form input[type="file"] { max-width: 100%; font-size: 14px; }

.table-wrap { overflow-x: auto; }
.var-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.var-table th, .var-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.var-table th { background: #f4f8fb; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.var-table td:first-child { white-space: nowrap; }
.req-table td:first-child { white-space: normal; width: 40%; }

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2f6;
    color: var(--muted);
    white-space: nowrap;
}
.tag-required { background: var(--danger-bg); color: var(--danger); }
.tag-ok { background: var(--ok-bg); color: var(--ok); }

@media (max-width: 760px) {
    .admin-header { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .brand small { display: none; }
    .header-user { flex-wrap: wrap; }
    .card { padding: 16px; }
}

/* Wide tables scroll sideways on phones instead of squashing columns. */
.table-wrap .var-table { min-width: 760px; }
@media (max-width: 760px) {
    .upload-row, .upload-form { width: 100%; }
    .upload-form button { width: 100%; }
}
