:root {
    --paper-width: 72mm;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.ticket-preview {
    width: var(--paper-width);
}

.ticket-paper {
    width: var(--paper-width);
    border: 1px dashed #94a3b8;
    background: #ffffff;
    color: #0f172a;
    padding: 8px;
    box-sizing: border-box;
    line-height: 1.35;
}

.ticket-header {
    text-align: center;
    margin-bottom: 8px;
}

.ticket-logo {
    display: block;
    width: 30px;
    height: 30px;
    margin: 0 auto 4px;
    object-fit: contain;
}

.ticket-title-top {
    margin: 2px 0;
    font-size: 12px;
    font-weight: 700;
}

.ticket-title-middle {
    margin: 2px 0;
    font-size: 13px;
    font-weight: 700;
}

.ticket-title-sub {
    margin: 4px 0 2px;
    font-size: 11px;
    font-weight: 700;
}

.ticket-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 0;
    font-size: 11px;
}

.ticket-line span:last-child {
    text-align: right;
    word-break: break-word;
}

.ticket-grid-head,
.ticket-grid-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    border-bottom: 1px dashed #cbd5e1;
    padding: 2px 0;
    font-size: 11px;
}

.ticket-grid-head {
    margin-top: 6px;
    border-top: 1px dashed #cbd5e1;
    font-weight: 700;
}

.ticket-grid-row span:last-child,
.ticket-grid-head span:last-child {
    text-align: right;
}

.ticket-total {
    margin-top: 6px;
    text-align: right;
    font-size: 11px;
}

.ticket-total div {
    display: inline-flex;
    gap: 10px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 4px;
    font-weight: 700;
}

.ticket-strong {
    font-weight: 700;
}

.ticket-words {
    margin: 8px 0 0;
    font-size: 11px;
    font-style: italic;
}

.ticket-date {
    margin: 8px 0 0;
    font-size: 10px;
    text-align: center;
}

.ticket-stamp {
    margin: 12px 0 6px;
    font-size: 10px;
}

.ticket-stamp-space {
    height: 18px;
    margin-bottom: 6px;
}

.print-wrapper {
    background: #f1f5f9;
    padding: 16px;
}

.print-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.print-actions a,
.print-actions button {
    border: 1px solid #94a3b8;
    background: #ffffff;
    color: #0f172a;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
}

@media print {
    @page {
        margin: 2mm;
        size: 80mm auto;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    .no-print {
        display: none !important;
    }

    .ticket-paper {
        border: none;
        width: var(--paper-width);
        margin: 0;
        padding: 0;
    }
}
