/* ================= Reset and Base Styles ================= */
html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f0f0f0;
}

* {
    box-sizing: border-box;
}

/* ================= App Container ================= */
.app {
    height: 100vh;
    overflow-y: auto;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* ================= Topbar ================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border-bottom: 3px solid #000;
    background: #fff;
    position: relative;
}

.topbar .logo {
    position: absolute;
    left: 16px;
    font-weight: bold;
    font-size: 20px;
}

.topbar .title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.logo {
    font-weight: bold;
}

/* ================= Booking Body ================= */
.booking-body {
    height: calc(100vh - 52px - 95px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.8fr;
    column-gap: 25px;
    padding: 20px;
    flex: 1;
}

/* ================= Columns ================= */
.col {
    display: flex;
    flex-direction: column;
}

/* ================= Row Layout ================= */
.row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.row.tight {
    margin-bottom: 4px;
}

.row.small-gap {
    margin-bottom: 8px;
}

.big-gap {
    height: 40px;
}

/* ================= Inputs ================= */
input[type="text"],
input[type="number"],
input[type="date"] {
    padding: 5px;
}

input {
    width: 210px;
}

input.small {
    width: 80px;
}

input.tiny {
    width: 45px;
    padding: 5px;
}

select {
    width: 210px;
    max-width: 100%;
}

/* ================= Fee Box ================= */
.fee-box {
    border: 2px solid #000;
    padding: 10px;
    margin-top: 20px;
}

.fee-title {
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.freight-row {
  align-items: center;
}

.freight-inputs {
  display: flex;
  gap: 6px;
}

/* ================= Actions ================= */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-shrink: 0;
}

.actions button {
    width: 110px;
    height: 35px;
    cursor: pointer;
}

/* ================= Dispatch Section ================= */
.dispatch-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid #000;
}

.dispatch-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
}

/* ================= Responsive ================= */
@media (max-width: 1000px) {
    .booking-body {
        grid-template-columns: 1fr;
    }
    .row {
        grid-template-columns: 1fr;
    }
    .row label {
        margin-bottom: 4px;
    }
}

/* ================= Print Layout ================= */
@media print {
    body * {
        visibility: hidden;
    }
    #printArea, #printArea * {
        visibility: visible;
    }
    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

.print-page {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
}

.receipt {
    width: 48%;
    border: 2px solid #000;
    padding: 15px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.receipt-header .logo {
    font-size: 48px;
    font-weight: bold;
}

.receipt-header .meta {
    text-align: right;
}

.receipt-header .meta div {
    margin-bottom: 4px;
}

.route {
    margin: 10px 0;
    font-weight: bold;
    text-align: center;
}

.field {
    display: flex;
    margin: 4px 0;
}

.field span:first-child {
    width: 90px;
    font-weight: bold;
}

.to-pay {
    margin-top: 10px;
    font-weight: bold;
    color: darkred;
    font-size: 18px;
}

.signature {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid #000;
    padding-top: 5px;
    font-weight: bold;
}

/* ================= Popup / Overlay ================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup {
    background: #fff;
    padding: 20px;
    width: 600px;
    max-height: 90%;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
}

.popup h3 {
    margin-top: 0;
}

.popup input,
.popup select {
    width: 100%;
    margin-bottom: 10px;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.popup.find-popup {
    width: 320px;
}

.col.left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.col.right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 10px; /* extra space to prevent pushing issues */
}

.right-scroll {
    overflow-y: auto;
    flex: 1;
}

.back-arrow{
    position:absolute;
    right:15px;
    top:50%;
    transform:translateY(-50%);
    font-size:22px;
    text-decoration:none;
    color:black;
    font-weight:bold;
}