/* ── Page shell ── */
.paper-shell {
    background: #e8e8e8;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(0, 0, 0, .03) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(0, 0, 0, .03) 25px);
    min-height: 100vh;
    padding: 32px 24px 64px;
}

/* ── Toolbar (above the paper) ── */
.paper-toolbar {
    max-width: var(--paper-max-width, 980px);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.paper-toolbar .paper-breadcrumb {
    /*font-size: .85rem;*/
    color: #555;
    margin-right: auto;
}

.paper-toolbar .paper-breadcrumb a {
    color: #7C3AED;
    text-decoration: none;
}

.paper-toolbar .paper-breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Paper card ── */
.paper-card {
    position: relative;
    max-width: var(--paper-max-width, 980px);
    margin: 0 auto 24px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12),
    0 4px 12px rgba(0, 0, 0, .10),
    0 16px 32px rgba(0, 0, 0, .07);
    padding: 48px 60px 56px;
    overflow: hidden;
}

/* coloured left binding strip */
.paper-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--paper-accent, linear-gradient(180deg, #7C3AED 0%, #4F46E5 100%));
    border-radius: 3px 0 0 3px;
}

/* accent colour helpers  (override --paper-accent or add a class) */
.paper-card.accent-purple::before {
    background: linear-gradient(180deg, #7C3AED, #4F46E5);
}

.paper-card.accent-blue::before {
    background: #3B82F6;
}

.paper-card.accent-green::before {
    background: #10B981;
}

.paper-card.accent-amber::before {
    background: #F59E0B;
}

.paper-card.accent-red::before {
    background: #EF4444;
}

.paper-card.accent-gray::before {
    background: #6B7280;
}

/* lighter shadow variant for sub-sections */
.paper-card.paper-card--light {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08),
    0 4px 10px rgba(0, 0, 0, .06);
    padding: 28px 60px 32px;
}

/* ── Status ribbon (corner badge) ── */
.paper-ribbon-wrap {
    width: 160px;
    height: 160px;
    overflow: hidden;
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 5;
    pointer-events: none;
}

.paper-ribbon-wrap span {
    position: absolute;
    display: block;
    width: 230px;
    padding: 9px 0;
    text-align: center;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    transform: rotate(45deg);
    top: 32px;
    right: -58px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
    font-size: 11px;
    background: #6B7280; /* default, overridden by modifier classes */
}

/* ribbon colour modifiers */
.paper-ribbon-wrap.ribbon-success span {
    background: #10B981;
}

.paper-ribbon-wrap.ribbon-warning span {
    background: #F59E0B;
}

.paper-ribbon-wrap.ribbon-danger span {
    background: #EF4444;
}

.paper-ribbon-wrap.ribbon-primary span {
    background: #4F46E5;
}

.paper-ribbon-wrap.ribbon-info span {
    background: #3B82F6;
}

.paper-ribbon-wrap.ribbon-secondary span {
    background: #6B7280;
}

/* ── Document header block ── */
.paper-doc-header {
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.paper-doc-code {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    color: #1F2937;
    letter-spacing: .04em;
}

.paper-doc-type {
    /*font-size: .72rem;*/
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #9CA3AF;
    margin-bottom: 4px;
}

/* ── Meta info grid ── */
.paper-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0 16px;
    margin-bottom: 32px;
}

.paper-meta-item {
    border-bottom: 1px dashed #E5E7EB;
    padding: 8px 0;
}

.paper-meta-label {
    display: block;
    color: #6B7280;
    /*font-size: .72rem;*/
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 3px;
}

.paper-meta-value {
    color: #111827;
    /*font-size: .9rem;*/
    font-weight: 600;
}

.paper-meta-value a {
    color: #4F46E5;
    text-decoration: none;
}

.paper-meta-value a:hover {
    text-decoration: underline;
}

/* ── Section label ── */
.paper-section-label {
    /*font-size: .7rem;*/
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #9CA3AF;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Section header (title + action button) ── */
.paper-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.paper-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1F2937;
}

.paper-section-amount {
    font-family: 'Courier New', monospace;
    /*font-size: .85rem;*/
    font-weight: 700;
    color: #6B7280;
    margin-left: 8px;
}

/* ── Paper-styled table ── */
.paper-table {
    width: 100%;
    border-collapse: collapse;
    /*font-size: .84rem;*/
    margin-bottom: 0;
}

.paper-table thead tr {
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    border-bottom: 2px solid #E5E7EB;
}

.paper-table thead th {
    padding: 9px 12px;
    /*font-size: .7rem;*/
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6B7280;
    text-align: left;
    white-space: nowrap;
}

.paper-table tbody tr {
    border-bottom: 1px solid #F3F4F6;
    transition: background .15s;
}

.paper-table tbody tr:hover {
    background: #FAFAFA;
}

.paper-table tbody td {
    padding: 9px 12px;
    color: #374151;
    vertical-align: middle;
}

.paper-table tfoot tr {
    border-top: 1px solid #E5E7EB;
}

.paper-table tfoot td {
    padding: 7px 12px;
}

.paper-table tfoot .paper-tfoot-total td {
    font-weight: 800;
    color: #111827;
    background: #F9FAFB;
}

.paper-table tfoot .paper-tfoot-sub td {
    color: #6B7280;
}

.paper-table tfoot .paper-tfoot-divider td {
    padding: 0;
}

.paper-table tfoot .paper-tfoot-divider hr {
    margin: 4px 0;
    border-color: #E5E7EB;
}

/* amount cells */
.paper-amount {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #111827;
    text-align: right;
    white-space: nowrap;
}

.paper-amount-label {
    text-align: right;
    font-weight: 600;
    color: #374151;
}

.paper-amount-danger {
    color: #EF4444;
}

/* ── Misc utility ── */
.paper-divider {
    border: none;
    border-top: 1px dashed #E5E7EB;
    margin: 24px 0;
}

.paper-note-block {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-left: 3px solid #7C3AED;
    border-radius: 0 4px 4px 0;
    padding: 14px 16px;
    color: #374151;
    line-height: 1.6;
    /*font-size: .85rem;*/
}

.paper-note-block .paper-note-label {
    /*font-size: .7rem;*/
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #7C3AED;
    margin-bottom: 6px;
}

.paper-reject-box {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 3px solid #EF4444;
    border-radius: 0 4px 4px 0;
    padding: 12px 16px;
    /*font-size: .85rem;*/
    color: #7F1D1D;
    margin-top: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .paper-card {
        padding: 28px 20px 32px;
    }

    .paper-card.paper-card--light {
        padding: 20px;
    }

    .paper-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    /*.paper-table { font-size: .78rem; }*/
}

@media (max-width: 480px) {
    .paper-shell {
        padding: 16px 10px 40px;
    }

    .paper-meta-grid {
        grid-template-columns: 1fr;
    }
}
