* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

h1,
h2,
h3 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea,
input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: #2563eb;
}

.btn.secondary {
    background: #64748b;
}

.btn.success {
    background: #059669;
}

.btn.warn {
    background: #ea580c;
}

.btn.danger {
    background: #dc2626;
}

.nav {
    background: #111827;
    color: #fff;
}

.nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.upload-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.flash {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
}

.text-muted {
    color: #555;
    font-size: 14px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.filter-actions {
    align-self: end;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.data-table th,
.data-table td {
    border: 1px solid #d1d5db;
    padding: 8px;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
    white-space: nowrap;
}

.data-table thead th {
    background: #f3f4f6;
    font-weight: 700;
}

.row-actions {
    flex-wrap: nowrap;
}

.row-actions form {
    margin: 0;
}

.row-actions .btn {
    padding: 7px 10px;
    font-size: 13px;
}

.receipt-slip {
    max-width: 420px;
    margin: 0 auto 14px;
    color: #222;
}

.receipt-title {
    margin-bottom: 2px;
    text-align: center;
    letter-spacing: 0.5px;
}

.receipt-sub {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

.receipt-line {
    border-top: 1px solid #444;
    margin: 8px 0;
}

.receipt-gold {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.receipt-row {
    display: grid;
    grid-template-columns: 112px 14px 1fr auto;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
    font-size: 20px;
}

.receipt-round {
    margin-left: 10px;
    width: 36px;
    height: 36px;
    border: 2px solid #444;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transform: rotate(-12deg);
}

.receipt-box {
    border: 2px solid #444;
    margin-top: 12px;
}

.receipt-box-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    border-bottom: 2px solid #444;
}

.receipt-box-row:last-child {
    border-bottom: none;
}

.receipt-box-row span {
    padding: 8px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-box-row span:last-child {
    border-left: 2px solid #444;
    text-align: center;
}

.receipt-actions {
    justify-content: flex-start;
}

@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions .btn,
    .row-actions .btn,
    .receipt-actions .btn {
        width: auto;
    }

    .receipt-row {
        font-size: 16px;
        grid-template-columns: 92px 12px 1fr auto;
    }

    .receipt-box-row {
        font-size: 22px;
        grid-template-columns: minmax(0, 1fr) 96px;
    }

}

@media print {
    @page {
        size: 80mm auto;
        margin: 2mm;
    }

    body {
        background: #fff;
    }

    .nav,
    .btn-row {
        display: none !important;
    }

    .container {
        width: 100%;
        max-width: 76mm;
        padding: 0;
        margin: 0 auto;
    }

    .card {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }

    .receipt-slip {
        max-width: 76mm;
        margin: 0;
    }

    .receipt-title {
        font-size: 22px;
    }

    .receipt-sub {
        font-size: 12px;
    }

    .receipt-gold {
        font-size: 24px;
    }

    .receipt-row {
        font-size: 16px;
        grid-template-columns: 88px 10px 1fr auto;
    }

    .receipt-box-row {
        font-size: 22px;
        grid-template-columns: minmax(0, 1fr) 96px;
    }

    .receipt-actions {
        display: none !important;
    }
}
