/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; color: #2d3748; background: #f4f6f9; }

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 64px; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #e8ecf0;
}
.navbar-brand  { display: flex; align-items: center; line-height: 0; }
.brand-logo    { display: block; height: 30px; width: auto; }
.btn-logout {
    background: transparent; border: 1px solid #d1d5db; color: #374151;
    padding: 5px 16px; border-radius: 5px; font-size: 13px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-logout:hover { background: #f9fafb; border-color: #9ca3af; color: #111827; }

/* ── Layout ───────────────────────────────────────────── */
.app-shell    { height: 100vh; display: flex; flex-direction: column; padding-top: 64px; }
.layout       { display: flex; flex: 1; min-height: 0; }
.sidebar      { width: 200px; background: #fff; border-right: 1px solid #e8ecf0; flex-shrink: 0; padding-top: 16px; }
.sidebar-nav  { display: flex; flex-direction: column; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; color: #555; font-size: 14px; text-decoration: none;
    border-left: 3px solid transparent; transition: all .15s;
}
.sidebar-link:hover  { background: #f0f4ff; color: #2563eb; }
.sidebar-link.active { background: #eff4ff; color: #2563eb; border-left-color: #2563eb; font-weight: 500; }
.sidebar-icon { width: 16px; text-align: center; font-size: 15px; }
.main-content { flex: 1; padding: 24px; overflow-x: hidden; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
    width: 100%; min-height: 78px; background: #fff;
    border-top: 1px solid #dfe4ea;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 28px;
}
.site-footer__version {
    font-size: 16px; font-weight: 500; color: #5b6573;
}
.site-footer__brand {
    display: block; width: auto; height: 42px; max-width: 100%;
}

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Page Header ──────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-header h1 { font-size: 20px; font-weight: 600; color: #1a1f36; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 500;
    cursor: pointer; border: none; text-decoration: none; transition: opacity .15s, background .15s;
}
.btn:hover     { opacity: .88; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-secondary { background: #f1f3f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; opacity: 1; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn-icon {
    width: 32px; height: 32px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: #fff; color: #555;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none; transition: all .15s; font-size: 13px;
}
.btn-icon:hover { background: #f0f4ff; color: #2563eb; border-color: #c7d7fd; }

/* ── Card ─────────────────────────────────────────────── */
.card { background: #fff; border-radius: 8px; border: 1px solid #e8ecf0; overflow: hidden; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid #f0f2f5;
}
.card-title { font-size: 15px; font-weight: 600; color: #2563eb; }

/* ── Table ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table       { width: 100%; border-collapse: collapse; }
thead tr    { background: #f8fafc; }
th {
    padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600;
    color: #6b7280; border-bottom: 1px solid #e8ecf0; white-space: nowrap;
}
td {
    padding: 11px 16px; font-size: 13px; color: #374151;
    border-bottom: 1px solid #f0f2f5; vertical-align: middle;
}
tbody tr:hover              { background: #fafbff; }
tbody tr:last-child td      { border-bottom: none; }
.actions-cell               { display: flex; align-items: center; gap: 6px; }

/* ── Badges ───────────────────────────────────────────── */
.badge       { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-blue  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-green { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-gray  { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* ── Search ───────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input {
    padding: 7px 12px 7px 34px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 13px; background: #fafbff; width: 220px; color: #374151;
    outline: none; transition: border .15s;
}
.search-wrap input:focus { border-color: #93c5fd; background: #fff; }
.search-wrap .search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; font-size: 13px;
}

/* ── Forms ────────────────────────────────────────────── */
.form-card   { background: #fff; border-radius: 8px; border: 1px solid #e8ecf0; padding: 28px; max-width: 640px; }
.form-title  { font-size: 16px; font-weight: 600; color: #1a1f36; margin-bottom: 24px; }
.form-group  { margin-bottom: 18px; }
.form-label  { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-label .req { color: #ef4444; margin-left: 2px; }
.req         { color: #ef4444; margin-left: 2px; }
.form-control {
    width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; color: #374151; background: #fff; outline: none; transition: border .15s;
}
.form-control:focus    { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-control[readonly]{ background: #f9fafb; color: #6b7280; cursor: default; }
.form-control.is-invalid { border-color: #f87171; }
select.form-control    { cursor: pointer; }
.invalid-feedback      { font-size: 12px; color: #ef4444; margin-top: 4px; }
.form-actions          { display: flex; gap: 10px; margin-top: 24px; }

/* ── Copy to clipboard ────────────────────────────────── */
.copy-wrap               { position: relative; display: flex; align-items: center; }
.copy-wrap .form-control { padding-right: 38px; }
.copy-btn {
    position: absolute; right: 8px; background: none; border: none;
    cursor: pointer; color: #9ca3af; font-size: 13px; padding: 2px; transition: color .15s;
}
.copy-btn:hover  { color: #2563eb; }
.copy-tooltip {
    position: absolute; right: 0; top: -30px;
    background: #1a1f36; color: #fff; font-size: 11px;
    padding: 3px 8px; border-radius: 4px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.copy-tooltip.show { opacity: 1; }

/* ── PDF Viewer ───────────────────────────────────────── */
.pdf-viewer {
    width: 100%; height: 500px;
    border: 1px solid #e8ecf0; border-radius: 6px; margin-top: 6px;
}
.pdf-link {
    font-size: 13px; color: #2563eb; text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
}
.pdf-link:hover { text-decoration: underline; }

/* ── Login Page ───────────────────────────────────────── */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: #f4f6f9;
}
.login-card {
    background: #fff; border-radius: 10px; border: 1px solid #e8ecf0;
    padding: 40px; width: 100%; max-width: 380px;
}
.login-logo  { display: flex; justify-content: center; line-height: 0; margin-bottom: 20px; }
.login-logo-image { display: block; height: 32px; width: auto; max-width: 100%; }
.login-title { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 20px; text-align: center; }

/* ── Public Verify Page ───────────────────────────────── */
.verify-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #f4f6f9; padding: 20px;
}
.verify-card {
    background: #fff; border-radius: 10px; border: 1px solid #e8ecf0;
    padding: 40px; width: 100%; max-width: 440px;
}
.verify-logo  { display: flex; justify-content: center; line-height: 0; margin-bottom: 20px; }
.verify-logo-image { display: block; height: 32px; width: auto; max-width: 100%; }
.verify-title { font-size: 18px; font-weight: 600; color: #1a1f36; margin-bottom: 6px; text-align: center; }
.verify-sub   { font-size: 13px; color: #6b7280; text-align: center; margin-bottom: 28px; }
.result-box   { border-radius: 8px; padding: 16px; margin-top: 20px; font-size: 14px; font-weight: 500; text-align: center; }
.result-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.result-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Pagination ───────────────────────────────────────── */
.pagination { display: flex; gap: 4px; list-style: none; }
.pagination li a, .pagination li span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px; font-size: 13px;
    border: 1px solid #e2e8f0; color: #374151; text-decoration: none; transition: all .15s;
}
.pagination li.active span { background: #2563eb; color: #fff; border-color: #2563eb; }
.pagination li a:hover      { background: #f0f4ff; color: #2563eb; border-color: #c7d7fd; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar       { height: 56px; padding: 0 16px; }
    .brand-logo   { height: 26px; }
    .app-shell    { padding-top: 56px; }
    .layout       { min-height: 0; }
    .sidebar      { width: 56px; }
    .sidebar-link span { display: none; }
    .sidebar-icon { margin: 0; }
    .sidebar-link { justify-content: center; padding: 12px; }
    .main-content { padding: 16px; }
    .search-wrap input { width: 160px; }
    .form-card    { padding: 20px; }
    .site-footer  { min-height: 96px; padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .site-footer__version { font-size: 14px; }
    .site-footer__brand { height: 34px; align-self: flex-end; }
}
