:root {
    --oaib-red: #e30613;
    --oaib-dark-red: #b9050f;
    --bg-color: #f4f6f9;
    --text-color: #333;
    --line: #e7e9ee;
    --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    font-family: 'Roboto', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

a { color: var(--oaib-red); }

/* HEADER */
.top-banner {
    width: 100%;
    background: linear-gradient(135deg, #b30000 0%, #E60000 100%);
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.25);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 32px;
}
.header-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.logo-box img {
    height: 42px;
    width: auto;
    background: #fff;
    padding: 2px;
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.header-text h1 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}

/* PAGE + NAV */
.page {
    width: min(500px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 40px;
}
.page.wide { width: min(820px, 94vw); }

.appnav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}
.appnav a { text-decoration: none; font-weight: 500; }
.appnav a:hover { text-decoration: underline; }
.appnav .spacer { flex: 1; }
.appnav .who { color: var(--text-color); font-weight: 500; }

/* CARD */
.container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* TABS */
.tabsel { position: absolute; opacity: 0; pointer-events: none; }

.pdf-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    user-select: none;
    flex-shrink: 0;
}
.pdf-tab {
    flex: 1;
    padding: 18px 5px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.pdf-tab i { margin-right: 6px; }
.pdf-tab:hover { background-color: #fff; color: var(--oaib-red); }

#tab-link:checked ~ .container label[for="tab-link"],
#tab-text:checked ~ .container label[for="tab-text"],
#tab-file:checked ~ .container label[for="tab-file"] {
    background-color: #fff;
    color: var(--oaib-red);
    border-bottom: 3px solid var(--oaib-red);
}

.content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* PANELS (CSS-only tab switching, no JS) */
.panel { display: none; flex-direction: column; }
#tab-link:checked ~ .container .p-link,
#tab-text:checked ~ .container .p-text,
#tab-file:checked ~ .container .p-file { display: flex; }

.panel h2 {
    font-size: 16px;
    margin: 0 0 4px;
    color: var(--text-color);
}
.panel .hint {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 16px;
}

/* FORM ELEMENTS */
label.field {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="url"],
textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid #dcdfe4;
    border-radius: 6px;
    font: inherit;
    background: #fcfcfc;
    margin-bottom: 1.25rem;
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--oaib-red);
    background: #fff;
}
textarea { resize: vertical; min-height: 96px; }

/* UPLOAD */
.pdf-upload-wrapper {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 24px 15px;
    text-align: center;
    background-color: #fcfcfc;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    min-height: 130px;
}
.pdf-upload-wrapper:hover { border-color: var(--oaib-red); background-color: #fff; }
.pdf-upload-wrapper.dragover {
    border-color: var(--oaib-red);
    border-style: solid;
    background-color: #fff5f5;
}
.pdf-upload-wrapper.has-file { border-style: solid; border-color: var(--oaib-red); }
.pdf-file-name {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--oaib-dark-red);
    word-break: break-all;
    padding: 0 8px;
}
.pdf-upload-icon { font-size: 32px; color: #ccc; margin-bottom: 10px; transition: color 0.3s; }
.pdf-upload-wrapper:hover .pdf-upload-icon { color: var(--oaib-red); }
.pdf-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}
.pdf-upload-wrapper p { margin: 0; color: var(--muted); font-size: 14px; }

button,
.btn {
    background-color: var(--oaib-red);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    width: 100%;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
}
button:hover,
.btn:hover { background-color: var(--oaib-dark-red); }
button:active,
.btn:active { transform: scale(0.98); }
.btn.ghost {
    background: #fff;
    color: var(--oaib-red);
    border: 1px solid var(--oaib-red);
}
.btn.ghost:hover { background: #fff5f5; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }

.btn-row { display: flex; gap: 10px; margin-top: 4px; }

/* ALERT */
.alert {
    color: var(--oaib-red);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    background: #ffe6e6;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fadbd8;
}

/* LOGIN */
.login-card .content { padding: 2.25rem 2rem; }
.login-card h2 { margin: 0 0 4px; font-size: 18px; }
.login-card .hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

/* RESULT */
.result-card .content { align-items: center; text-align: center; }
.qr-frame {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 6px 0 18px;
}
.qr-frame img { display: block; width: 260px; height: 260px; }
.kv {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
    word-break: break-all;
}
.kv span:first-child { color: var(--muted); flex: 0 0 110px; }
.kv a { font-weight: 500; }

/* TABLE */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.tbl th {
    background: #f8f9fa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl .ttl { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.textbox {
    width: 100%;
    margin: 4px 0 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: 14px/1.5 'Roboto', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

footer.foot {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.7;
    margin-top: 26px;
    padding: 8px 0 28px;
}
