/* Hướng dẫn sử dụng — shared styles (extracted from huong-dan-su-dung-phieu-de-xuat-thanh-toan.html) */
:root {
    --c-primary: #e2c800;
    --c-primary-dark: #b89a00;
    --c-text: #1a1a2e;
    --c-muted: #6b7280;
    --c-border: #e4e6eb;
    --c-bg: #f8f9fb;
    --c-create: #0084ff;
    --c-confirm: #0284c7;
    --c-approve: #16a34a;
    --c-pay: #8b5cf6;
    --c-warn: #f59e0b;
    --c-danger: #dc2626;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.6;
    font-size: 14.5px;
}

.hd-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff;
    padding: 28px 24px;
    border-bottom: 4px solid var(--c-primary);
}
.hd-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.hd-logo {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fe0; border-radius: 10px; padding: 8px 12px;
    flex-shrink: 0; transition: transform .15s, box-shadow .15s;
}
.hd-logo:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.hd-logo img { height: 34px; display: block; }
.hd-back {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid #374151;
    border-radius: 6px;
    transition: all .15s;
    background: transparent;
    cursor: pointer;
}
.hd-back:hover { background: #1f2937; color: #fff; }
.hd-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    flex: 1;
}
.hd-title i { color: var(--c-primary); margin-right: 8px; }
.hd-meta { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.hd-wrap {
    max-width: 1200px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 0 24px;
}
@media (max-width: 920px) {
    .hd-wrap { grid-template-columns: 1fr; }
    .hd-sidebar { position: static !important; }
}

.hd-sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 14px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
.hd-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--c-muted);
    margin-bottom: 10px;
}
.hd-toc { list-style: none; padding: 0; margin: 0; }
.hd-toc li { margin-bottom: 2px; }
.hd-toc a {
    display: block;
    padding: 7px 10px;
    color: var(--c-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: all .12s;
    border-left: 3px solid transparent;
}
.hd-toc a:hover {
    background: #f3f4f6;
    border-left-color: var(--c-primary);
}
.hd-toc a i { width: 16px; margin-right: 6px; }
.hd-toc .lvl2 { padding-left: 26px; font-size: 12.5px; color: var(--c-muted); }

.hd-main { min-width: 0; }
.hd-section {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 18px;
}
.hd-section h2 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--c-text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.hd-section h2 .hd-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}
.hd-section h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 700; }
.hd-section p, .hd-section li { font-size: 14px; color: #1f2937; }

.hd-section.create h2 .hd-num { background: var(--c-create); }
.hd-section.create h2 { color: var(--c-create); }
.hd-section.approve h2 .hd-num { background: var(--c-approve); }
.hd-section.approve h2 { color: var(--c-approve); }
.hd-section.pay h2 .hd-num { background: var(--c-pay); }
.hd-section.pay h2 { color: var(--c-pay); }
.hd-section.intro h2 .hd-num { background: var(--c-warn); }
.hd-section.intro h2 { color: #b45309; }
.hd-section.faq h2 .hd-num { background: #64748b; }
.hd-section.faq h2 { color: #475569; }

.hd-steps { counter-reset: step; }
.hd-step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 14px;
    margin: 10px 0;
    border-left: 3px solid var(--c-border);
    background: #fafbfc;
    border-radius: 0 8px 8px 0;
}
.hd-step.create { border-left-color: var(--c-create); }
.hd-step.confirm { border-left-color: var(--c-confirm); }
.hd-step.approve { border-left-color: var(--c-approve); }
.hd-step.pay { border-left-color: var(--c-pay); }
.hd-step-num {
    counter-increment: step;
    width: 32px;
    height: 32px;
    background: var(--c-text);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.hd-step-num::before { content: counter(step); }
.hd-step.create .hd-step-num { background: var(--c-create); }
.hd-step.confirm .hd-step-num { background: var(--c-confirm); }
.hd-step.approve .hd-step-num { background: var(--c-approve); }
.hd-step.pay .hd-step-num { background: var(--c-pay); }
.hd-step-body { min-width: 0; }
.hd-step-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.hd-step-desc { color: #4b5563; font-size: 13.5px; }
.hd-step-desc ul { margin: 6px 0; padding-left: 22px; }
.hd-step-desc li { margin: 3px 0; }

.hd-status {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
    vertical-align: middle;
}
.st-draft   { background: #f3f4f6; color: #4b5563; }
.st-confirm { background: #cffafe; color: #0e7490; }
.st-pending { background: #fef3c7; color: #b45309; }
.st-approve { background: #dcfce7; color: #15803d; }
.st-reject  { background: #fee2e2; color: #b91c1c; }
.st-paid    { background: #dbeafe; color: #1d4ed8; }
.st-cancel  { background: #f1f5f9; color: #475569; }
.st-open    { background: #dbeafe; color: #1d4ed8; }
.st-progress{ background: #fef3c7; color: #b45309; }
.st-resolved{ background: #dcfce7; color: #15803d; }
.st-closed  { background: #f1f5f9; color: #475569; }
.st-active  { background: #dbeafe; color: #1e40af; }
.st-hold    { background: #fef3c7; color: #b45309; }
.st-done    { background: #dcfce7; color: #166534; }

.hd-flow {
    background: #fff;
    border: 2px dashed var(--c-border);
    border-radius: 10px;
    padding: 16px;
    margin: 14px 0;
    overflow-x: auto;
}
.hd-flow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    font-size: 13px;
    min-width: max-content;
}
.hd-flow-node {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.hd-flow-arr { color: var(--c-muted); font-weight: 700; }

.hd-tip, .hd-warn, .hd-info {
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 13.5px;
    border-left: 4px solid;
    display: flex;
    gap: 10px;
}
.hd-tip { background: #fefce8; border-color: var(--c-primary); color: #78350f; }
.hd-warn { background: #fef2f2; border-color: var(--c-danger); color: #7f1d1d; }
.hd-info { background: #eff6ff; border-color: var(--c-create); color: #1e3a8a; }
.hd-tip i, .hd-warn i, .hd-info i { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.hd-tip strong, .hd-warn strong, .hd-info strong { display: block; margin-bottom: 2px; }

.hd-fields {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}
.hd-fields th, .hd-fields td {
    border: 1px solid var(--c-border);
    padding: 8px 10px;
    text-align: left;
}
.hd-fields th { background: #f8fafc; font-weight: 700; color: #374151; }
.hd-fields td code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #b91c1c;
}
.req { color: var(--c-danger); font-weight: 700; }

.hd-faq-item { border-bottom: 1px solid var(--c-border); padding: 12px 0; }
.hd-faq-item:last-child { border-bottom: 0; }
.hd-faq-q { font-weight: 700; color: var(--c-text); margin-bottom: 6px; cursor: pointer; }
.hd-faq-q i { color: var(--c-primary); margin-right: 6px; }
.hd-faq-a { color: #4b5563; font-size: 13.5px; }

kbd {
    background: #1f2937;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}
.hd-link { color: var(--c-create); text-decoration: none; font-weight: 600; }
.hd-link:hover { text-decoration: underline; }
.hd-pill {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 2px;
}

@media print {
    .hd-header, .hd-sidebar, .hd-back { display: none; }
    .hd-wrap { grid-template-columns: 1fr; max-width: 100%; }
    .hd-section { break-inside: avoid; box-shadow: none; }
}

/* Nút "Lên đầu trang" — fixed bottom-right, ẩn khi gần top */
#hdToTop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-text);
    border: 1px solid var(--c-primary-dark);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s, transform .18s, background .15s;
    z-index: 1000;
}
#hdToTop:hover { background: var(--c-primary-dark); }
#hdToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (max-width: 576px) {
    #hdToTop { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}
@media print { #hdToTop { display: none !important; } }
