body {
    background: #f5f7fb;
    color: #1f2937;
}

.navbar {
    min-height: 58px;
}

.layout {
    display: flex;
    padding-top: 58px;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 58px;
    bottom: 0;
    width: 230px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
}

.content {
    width: 100%;
    padding: 24px;
}

@media (min-width: 992px) {
    .content {
        margin-left: 230px;
    }
}

.panel,
.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.panel-title {
    font-weight: 700;
    margin-bottom: 14px;
}

.stat-value {
    font-size: 30px;
    line-height: 1.35;
    font-weight: 800;
    color: #0f766e;
}

.chart {
    width: 100%;
    height: 360px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eef6ff 0%, #f8fafc 52%, #eefdf7 100%);
}

.login-card {
    width: min(420px, calc(100vw - 32px));
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
}

.table th {
    white-space: nowrap;
    color: #475569;
    font-size: 14px;
}

.qr-box,
.qr-preview {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
}

.qr-box img,
.qr-preview img {
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
}

.record-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
}

.record-head {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.record-help {
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.record-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, 0.8fr);
    gap: 12px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.record-amounts-single {
    grid-template-columns: minmax(260px, 360px) minmax(220px, 1fr);
}

.record-total {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 6px 12px;
    background: #f8fafc;
}

.record-total strong {
    color: #b91c1c;
    font-size: 18px;
}

.record-price-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #475569;
}

.record-price-bar span {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
}

.record-batch-total {
    max-width: 420px;
    margin-left: auto;
}

.unsettled-preview {
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}

.unsettled-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.unsettled-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    color: #64748b;
}

.unsettled-summary strong {
    color: #64748b;
}

.unsettled-summary .unsettled-total {
    background: #fff7ed;
    border-color: #fed7aa;
}

.unsettled-summary .unsettled-total strong {
    color: #b91c1c;
    font-size: 20px;
}

.table-pager .btn {
    min-width: 38px;
}

.option-list {
    display: grid;
    gap: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8fafc;
}

.option-item span {
    min-width: 0;
    word-break: break-word;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.bill-sheet {
    background: #ffffff;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    padding: 28px;
}

.bill-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 3px solid #0f766e;
    margin-bottom: 20px;
}

.bill-title-row h2 {
    margin: 4px 0 0;
    font-size: 30px;
    font-weight: 800;
    color: #111827;
}

.bill-brand {
    color: #0f766e;
    font-weight: 700;
    font-size: 14px;
}

.bill-meta {
    text-align: right;
    color: #475569;
    line-height: 1.9;
}

.bill-customer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 18px;
}

.bill-private-info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}

.bill-private-info > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bill-private-info span {
    color: #64748b;
    font-size: 13px;
}

.bill-private-info strong {
    color: #111827;
}

.bill-customer > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bill-customer span {
    color: #64748b;
    font-size: 13px;
}

.bill-section-title {
    margin: 18px 0 10px;
    font-weight: 800;
    color: #111827;
}

.bill-table th {
    background: #f1f5f9;
    color: #334155;
}

.bill-total {
    font-size: 20px;
    color: #b91c1c;
}

.bill-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.bill-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fafc;
}

.bill-summary span {
    color: #64748b;
}

.bill-summary-total {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    font-size: 20px;
}

.bill-summary-total strong {
    color: #b91c1c;
}

.bill-payment {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin-top: 18px;
}

.bill-payment .qr-box {
    flex: 1 1 0;
    min-width: 0;
}

.bill-payment .qr-box img {
    max-width: min(160px, 100%);
    max-height: 160px;
}

@media (max-width: 575.98px) {
    .content {
        padding: 16px 12px;
    }

    .panel,
    .stat-card {
        padding: 14px;
    }

    .record-row {
        grid-template-columns: 1fr;
    }

    .record-amounts,
    .bill-summary,
    .unsettled-summary {
        grid-template-columns: 1fr;
    }

    .bill-title-row,
    .bill-customer,
    .bill-private-info {
        grid-template-columns: 1fr;
    }

    .bill-payment {
        gap: 8px;
    }

    .bill-payment .qr-box {
        padding: 8px;
        min-height: 150px;
    }

    .bill-payment .qr-box img {
        max-height: 125px;
    }

    .bill-title-row {
        display: block;
    }

    .bill-meta {
        text-align: left;
        margin-top: 10px;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .navbar,
    .sidebar,
    .no-print,
    .modal-header {
        display: none !important;
    }

    .layout {
        display: block;
        padding-top: 0;
    }

    .content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .modal {
        position: static !important;
        display: block !important;
    }

    .modal-dialog {
        max-width: none;
        margin: 0;
    }

    .modal-content {
        border: 0;
        box-shadow: none;
    }

    .bill-sheet {
        border: 0;
        border-radius: 0;
        padding: 0;
    }
}
