:root {
    --ink: #2b2b2b;
    --paper: #f6e58d;
    --accent: #8a6d00;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0ede4;
    color: var(--ink);
    margin: 0;
    padding: 24px;
}

.topbar {
    max-width: 900px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

.topbar a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 16px;
}

.topbar .user-info {
    font-size: 13px;
    color: #777;
}

.login-wrap {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 360px;
    text-align: center;
}

.login-card h1 {
    font-size: 18px;
    margin: 0 0 18px;
}

.login-card form {
    text-align: left;
}

.login-logo {
    width: 72px;
    height: auto;
    margin-bottom: 12px;
}

.error {
    background: #fdecea;
    color: #b91c1c;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.card {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field { margin-bottom: 16px; }

input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn.secondary {
    background: #eee;
    color: var(--ink);
}

.actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th, table td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid #eee;
}

table th {
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
}

table tr:hover { background: #fafafa; }

.search {
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: #eef;
}

.badge-fc   { background: #dff0d8; color: #3a763a; }
.badge-nonfc { background: #eef; color: #333; }

.radio-group {
    display: flex;
    gap: 24px;
    padding: 6px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* ---- Receipt layout ---- */
.receipt-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.receipt {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 26px 32px;
    position: relative;
}

.receipt-head {
    border-bottom: 2px solid var(--ink);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.receipt-head-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.tax-exempt {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .2px;
    padding-top: 2px;
}

.receipt-head .org-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.receipt-head .org-logo {
    width: 48px;
    height: auto;
    flex-shrink: 0;
    margin-top: 2px;
}

.receipt-head .org-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .5px;
}

.receipt-head .org-meta {
    font-size: 12px;
    line-height: 1.5;
}

.receipt-head .receipt-no {
    text-align: right;
    font-size: 14px;
}

.receipt-head .receipt-no .num {
    color: #c0392b;
    font-size: 22px;
    font-weight: 800;
}

.receipt-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 10px 0;
    font-size: 15px;
}

.receipt-row .label {
    font-style: italic;
    white-space: nowrap;
    color: #444;
}

.receipt-row .dotted {
    flex: 1;
    border-bottom: 1px dotted #555;
    min-height: 20px;
    padding: 0 4px;
    font-weight: 600;
}

.receipt-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.receipt-foot .date-block, .receipt-foot .sign-block {
    text-align: center;
    font-size: 13px;
}

.receipt-foot .dotted-line {
    border-bottom: 1px dotted #555;
    min-width: 180px;
    min-height: 20px;
    margin-bottom: 4px;
    font-weight: 600;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.signature-img {
    max-height: 45px;
    max-width: 170px;
    object-fit: contain;
}

.print-actions {
    margin: 16px 0;
    display: flex;
    gap: 10px;
}

@media print {
    body { background: #fff; padding: 0; }
    .no-print { display: none !important; }
    .receipt-wrap { max-width: none; }
    .receipt { box-shadow: none; }
    @page { size: 190mm 120mm landscape; margin: 6mm; }
}
