/* =========================================================
   SHAMBA - TABLET / DESKTOP
   Intended for iPad/tablet and PC layouts (768px+).
   ========================================================= */

/* DATA TABLE */
.data-table {
    font-size: 0.85rem;
}

.dt-container .dt-search input {
    min-height: 30px;
    padding: 4px 8px;
}

/* BANNER */
.new-order-banner {
    display: flex;
    align-items: center;
    gap: 20px;

    width: 100%;
    padding: 14px 18px;
    box-sizing: border-box;

    background: #fff8e7;
    border: 1px solid #e6d29a;
    border-radius: 0;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);

    color: #333;
}

.new-order-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.new-order-banner-icon {
    flex-shrink: 0;

    font-size: 28px;
    line-height: 1;
}

.new-order-banner-message {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.new-order-banner-message strong {
    color: #315b3a;
    font-size: 17px;
}

.new-order-banner-message span {
    font-size: 14px;
    color: #555;
}

.new-order-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#newOrderBannerOk {
    width: 100px;
    margin: 0;
}

.page-narrow {
    --base-font-size: 13px;
    max-width: 650px;
    font-size: var(--base-font-size);
}
.page-medium {
    --base-font-size: 13px;
    max-width: 900px;
    font-size: var(--base-font-size);
}

.page-narrow .text-input,
.page-narrow .notes-field,
.page-medium .text-input,
.page-medium .notes-field{
    min-height: 40px;
    padding: 8px 10px;
    font-size: var(--base-font-size);
}

.page-narrow .field-label,
.page-medium .field-label{
    font-size: var(--base-font-size);
}

.page-narrow .field-help,
.page-medium .field-help{
    font-size: 0.72rem;
}

.page-narrow .button,
.page-medium .button{
    font-size: var(--base-font-size);
}

.page-narrow .page-header h1,
.page-medium .page-header h1{
    font-size: 24px;
}

.page-narrow .page-header p,
.page-medium .page-header p{
    font-size: var(--base-font-size);
}


.edit-row {
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    margin-bottom: 12px;
}

.edit-row .field-label {
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
}

.edit-row .field-help {
    grid-column: 2;
    margin-top: 0;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #777;
}

.edit-row input[type="checkbox"] {
    justify-self: start;
    align-self: center;
}

/* Shared rules that were previously @media (min-width: 700px) */
.display-none-pc {
    display: none !important;
}

.page {
    padding-top: 30px;
}

.inventory-card {
    padding: 22px;
}

/* Shop sizing that was previously @media (min-width: 700px) */

.shop-card {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.shop-item-image img {
    width: 75%;
    max-width: 550px;
}

/* =========================================================
   ORDER LIST - TABLET / DESKTOP
   ========================================================= */

.order-filter {
    margin-bottom: 18px;
}

.order-filter form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.order-filter-field {
    min-width: 140px;
}

.order-filter-customer {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
}

.order-filter-field .field-label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.order-filter-field .text-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;

}

.order-filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.order-filter-actions .button {
    font-size: 0.8rem;
    padding: 5px 10px;
    min-height: 30px;
}


/* TABLE */

.order-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.82rem;
}

.order-table th,
.order-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #ddd;
}

.order-table th {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    background: #f5f5f5;
}

.order-table tbody tr:hover {
    background: #fafafa;
}


/* COLUMN FORMATTING */

.order-table-id {
    white-space: nowrap;
    font-weight: 700;
}

.order-table-date {
    white-space: nowrap;
}

.order-table-money {
    white-space: nowrap;
    text-align: right !important;
}

.order-table-count {
    text-align: center !important;
}

.order-table-customer {
    min-width: 150px;
}

#fromDate,
#toDate {
    width: 140px;
}

#statusId {
    width: 145px;
}

#customerName {
    width: 220px;
}

/* PAYMENT STATUS */

.order-payment-status {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.payment-paid {
    background: #e6f4ea;
    color: #1e6b36;
}

.payment-partial {
    background: #fff4d6;
    color: #7a5700;
}

.payment-unpaid {
    background: #fde8e8;
    color: #9b1c1c;
}

.order-status {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.payment-history-date {
    text-align: left;
    margin-bottom: 6px;
}

.payment-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}



/* Keep desktop order filters compact instead of inheriting
   the touch-sized shared input/button dimensions. */
.order-filter .text-input {
    min-height: 0;
    height: 28px;
    padding: 3px 7px;
    font-size: 0.8rem;
    line-height: 1.2;
}

.order-filter select.text-input {
    padding-top: 2px;
    padding-bottom: 2px;
}

.order-filter-actions .button {
    width: auto;
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* =========================================================
   INVENTORY LIST - TABLET / DESKTOP
   ========================================================= */

.inventory-report-header,
.inventory-report-row {
    grid-template-columns:
        minmax(220px, 2fr)
        100px
        150px
        90px
        100px
        100px;

    gap: 10px;
    padding: 8px 10px;
}

.inventory-report-price,
.inventory-report-updated {
    display: block;
    white-space: nowrap;
}

.inventory-report-number {
    text-align: center;
}

.inventory-label-desktop {
    display: inline;
}

.inventory-label-mobile {
    display: none;
}

/* =========================================================
   ORDER DETAIL - DESKTOP
   ========================================================= */

.order-detail-layout {
    grid-template-columns:
        minmax(200px, 1fr)
        minmax(200px, 1fr)
        minmax(200px, 1fr);

    gap: 18px;
    align-items: start;

    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.order-detail-section {
    height: 100%;
}

.order-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    max-width: 1200px;
    margin: 18px auto 0;
}

.order-detail-actions .button {
    width: auto;
}

/* =========================================================
   ORDER DETAIL - DESKTOP
   ========================================================= */

.order-edit-layout {
    display: grid;
    grid-template-columns: 525px fit-content(400px);
    gap: 1rem;
    align-items: start;
    justify-content: center;
}

.order-edit-main {
    min-width: 0;
}

.order-edit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-edit-sidebar .adjust-card {
    margin-bottom: 0;
}

@media (max-width: 800px) {

    .order-edit-layout {
        display: block;
        max-width: none;
    }

    .order-edit-sidebar {
        display: block;
    }

    .order-edit-sidebar .adjust-card {
        margin-bottom: 1rem;
    }
}

/* =========================================================
   EDIT ORDER - DESKTOP
   ========================================================= */

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ---------------------------------------------------------
   DELIVERY TAX RATES
   --------------------------------------------------------- */

.delivery-tax-rate-form {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.delivery-tax-state {
    width: 70px;
}

.delivery-tax-percent {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.delivery-tax-percent .text-input {
    width: 120px;
}

.delivery-tax-rate-table {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.inactive-row {
    opacity: 0.55;
}
/* ---------------------------------------------------------
   TAX REPORT
   --------------------------------------------------------- */

.tax-report-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tax-report-filter {
    margin-bottom: 1.5rem;
}

.tax-report-filter form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.tax-report-filter .text-input {
    width: 180px;
}

.tax-report-month {
    margin-bottom: 1rem;
}

.tax-report-table {
    min-width: 760px;
}

.tax-report-totals {
    max-width: 420px;
    margin: 1.25rem 0 0 auto;
    padding: 1rem;

    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.tax-report-totals > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 0.25rem 0;
}

.tax-report-totals strong {
    text-align: right;
    white-space: nowrap;
}

.tax-report-grand-total {
    margin-top: 0.5rem;
    padding-top: 0.65rem !important;
    border-top: 1px solid #ccc;
    font-size: 1.05rem;
}

/* Tax Report Summary */

.tax-report-summary {
    max-width: 420px;
    margin: 1.25rem 0 0 auto;
}

.tax-report-summary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 0.3rem 0;
}

.tax-report-summary-row strong {
    text-align: right;
    white-space: nowrap;
}

.tax-report-summary-total {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid #ddd;
}

.tax-report-table tfoot td {
    border-top: 2px solid #ccc;
    background: #f5f5f5;
}

.tax-report-table tfoot .number-column {
    text-align: right;
}

.herd-location-group {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
}

.herd-location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.herd-move-animal-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.herd-move-ear-tag {
    font-weight: 700;
}

.herd-move-animal-name {
    margin-left: auto;
}

.herd-move-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-top: 1px solid #ccc;
}

/* =========================================================
   PROCESSING OVERLAY
   ========================================================= */
.processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.55);
}

.processing-overlay[hidden] {
    display: none;
}

.processing-box {
    width: 320px;
    padding: 30px;

    background: white;
    border-radius: 10px;

    text-align: center;
}

.processing-spinner {
    width: 46px;
    height: 46px;

    margin: 0 auto 18px;

    border: 5px solid #dddddd;
    border-top-color: #333333;
    border-radius: 50%;

    animation: processing-spin 0.8s linear infinite;
}

body.processing {
    overflow: hidden;
}

@keyframes processing-spin {
    to {
        transform: rotate(360deg);
    }
}