:root {
    --app-bg: #f5f7fb;
    --app-border: #d9e0ea;
    --app-ink: #1f2937;
}

body {
    min-height: 100vh;
    padding-bottom: 96px;
    background: var(--app-bg);
    color: var(--app-ink);
}

.login-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 0;
}

.login-container {
    max-width: 420px;
}

.login-card {
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(10px);
}

.app-main {
    padding-top: 1rem;
}

.action-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
}

.order-card,
.customer-order-card,
.item-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
}

.order-card {
    width: 100%;
    padding: 1rem;
    text-align: left;
}

.customer-order-card {
    padding: 1rem;
}

.order-card:active,
.customer-order-card:active,
.item-card:active {
    transform: translateY(1px);
}

.order-comment {
    display: -webkit-box;
    overflow: hidden;
    color: #4b5563;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.order-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.item-card {
    padding: 1rem;
}

.item-title {
    font-size: 1rem;
    line-height: 1.3;
}

.serial-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.serial-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    color: #5b6472;
}

.print-label {
    display: none;
}

@media (min-width: 768px) {
    .app-main {
        max-width: 760px;
    }
}

@media print {
    @page {
        size: 60mm 70mm;
        margin: 0;
    }

    html,
    body {
        width: 60mm !important;
        min-width: 60mm !important;
        max-width: 60mm !important;
        height: 70mm !important;
        min-height: 70mm !important;
        max-height: 70mm !important;
        margin: 0;
        padding: 0;
        background: #fff;
        overflow: hidden;
    }

    body > :not(.print-label) {
        display: none !important;
    }

    .print-label {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        box-sizing: border-box;
        width: 60mm !important;
        min-width: 60mm !important;
        max-width: 60mm !important;
        height: 70mm !important;
        min-height: 70mm !important;
        max-height: 70mm !important;
        padding: 3mm;
        overflow: hidden;
        break-after: page;
        page-break-after: always;
        color: #000;
        background: #fff;
        font-family: Arial, Helvetica, sans-serif;
    }

    .label-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2mm;
        margin-bottom: 3mm;
    }

    .label-customer {
        display: -webkit-box;
        width: 100%;
        min-height: 0;
        font-size: 25pt;
        font-weight: 900;
        line-height: 0.92;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .label-order {
        flex: 1 1 auto;
        padding: 0.35mm 1mm;
        border: 0.35mm solid #000;
        border-radius: 1mm;
        overflow: hidden;
        font-size: 13pt;
        font-weight: 900;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    .label-date {
        flex: 0 0 auto;
        font-size: 11pt;
        font-weight: 800;
        line-height: 1;
        white-space: nowrap;
    }

    .label-comment {
        display: -webkit-box;
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        max-height: 100%;
        margin-top: 4mm;
        overflow: hidden;
        font-size: 22pt;
        font-weight: 900;
        line-height: 0.98;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
    }
}
