/* WeighbridgeTerminalV2 extracted page styles */

/* Booking search rows */
.wb-booking-row {
    transition: background .12s;
    background: #fff;
}
.wb-booking-row:hover {
    background: #f0f4ff;
}
.wb-booking-row--selected {
    background: #f0faf3 !important;
}
.wb-booking-row:last-child {
    border-bottom: none !important;
}

/* Compact header for WBT */
.page-header-compact {
    padding: 0.5rem 1rem !important;
    min-height: auto !important;
}
.page-header-compact .header-content h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0 !important;
}
.page-header-compact .header-content .text-muted {
    display: none;
}

.weighbridge-terminal {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 9rem);   /* Even more space (was 10rem) */
    gap: 0;
    overflow: hidden;
}

/* TOP BAR - Inline layout with indicator left, cards right */
.wb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0.55rem;
    background: linear-gradient(135deg, #005EB8 0%, #003d7a 100%);
    color: #fff;
    border-bottom: 2px solid var(--cwr-green, #27ae60);
}

.wb-indicator-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wb-indicator-display {
    background: linear-gradient(145deg, #1a5fa8 0%, #0d4277 100%);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--cwr-radius, 8px);
    padding: 0.15rem 0.7rem;
    min-width: 175px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.wb-indicator-display.stable {
    border-color: var(--cwr-green, #2ECC71);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.25);
}
.wb-indicator-display.unstable {
    border-color: #f39c12;
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.2);
}

.wb-weight-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;  /* Reduced */
}
.wb-weight-digits {
    font-family: var(--cwr-font, 'Inter', sans-serif);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}
.wb-weight-digits.wb-offline {
    color: rgba(255,255,255,0.3);
}
.wb-weight-unit {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}

.wb-indicator-status-row {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.2rem;
}

.wb-indicator-status-row .badge {
    font-size: 0.55rem;
    padding: 0.22rem 0.35rem;
}

.wb-indicator-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.wb-indicator-actions .btn {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.85);
    font-size: 0.75rem;  /* Slightly reduced */
}
.wb-indicator-actions .btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.wb-summary-cards {
    display: flex;
    flex: 1;
    gap: 0.3rem;
    align-items: center;
    justify-content: flex-end;
}
.wb-summary-card {
    text-align: center;
    padding: 0.16rem 0.42rem;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    min-width: 54px;
    transition: background 0.2s;
}
.wb-summary-card:hover {
    background: rgba(255,255,255,0.16);
}
.wb-summary-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--cwr-font, 'Inter', sans-serif);
}
.wb-summary-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3px;
    font-weight: 600;
}

/* CONFIG PANEL */
.wb-config-panel {
    margin: 0.5rem 1rem;
}
.wb-config-panel .card-body {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* MAIN CONTENT */
.wb-main-content {
    display: grid;
    grid-template-columns: 290px 1fr 280px;
    flex: 1;
    overflow: hidden;
}

/* QUEUE */
.wb-queue-panel, .wb-today-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
    overflow: hidden;
}
.wb-today-panel {
    border-right: none;
    border-left: 1px solid var(--bs-border-color, #dee2e6);
}

.wb-panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bs-light, #f8f9fa);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
}
.wb-panel-header h6 {
    margin-bottom: 0;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wb-panel-header .btn {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.8rem !important;
    flex-shrink: 0;
}

.wb-panel-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wb-panel-action-btn {
    white-space: nowrap;
}

.wb-panel-header--queue {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.wb-panel-header--queue h6 {
    flex: 1 1 100%;
    width: 100%;
    margin-bottom: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.wb-panel-header--queue .wb-panel-actions {
    width: 100%;
    justify-content: flex-start;
}

.wb-panel-header--tickets {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.wb-panel-header--tickets h6 {
    flex: 1 1 100%;
    width: 100%;
    margin-bottom: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.wb-panel-header--tickets .wb-panel-actions {
    width: 100%;
    justify-content: flex-end;
}

.wb-queue-list, .wb-tickets-list {
    flex: 1;
    overflow-y: auto;
}

.wb-queue-item {
    padding: 0.5rem 6.1rem 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.wb-queue-item:hover { background: var(--bs-light, #f8f9fa); }
.wb-queue-item.active { background: #e3f0ff; border-left: 3px solid var(--cwr-blue, #005EB8); }
.wb-queue-item.awaiting-return { border-left: 3px solid var(--cwr-green, #2ECC71); }

.wb-queue-delete {
    position: absolute;
    bottom: 0.45rem;
    right: 0.5rem;
    transform: none;
    padding: 0.12rem 0.35rem;
    font-size: 0.6rem;
    line-height: 1.15;
    font-weight: 700;
    border-radius: 0.4rem;
    opacity: 0.95;
    transition: opacity 0.2s;
}
.wb-queue-item:hover .wb-queue-delete {
    opacity: 1;
}

.wb-queue-vrn {
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.wb-queue-detail { font-size: 0.75rem; color: #666; }
.wb-queue-status { margin-top: 0.25rem; }
.wb-queue-time { font-size: 0.7rem; color: #999; }

.wb-queue-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: #999;
    gap: 0.5rem;
}
.wb-queue-empty i { font-size: 2rem; }

.wb-tickets-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    min-height: 10rem;
    color: #8a8f96;
}

.wb-tickets-empty i {
    font-size: 1.6rem;
}

/* TICKET WORKSPACE */
.wb-ticket-workspace {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;  /* No scrolling - content should fit in viewport */
}

.wb-no-ticket {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #999;
    gap: 0.5rem;
}
.wb-no-ticket i { font-size: 3rem; }

.wb-active-ticket {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.wb-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.wb-ticket-details {
    background: transparent;
    padding: 0;
}

/* Info chips */
.wb-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.wb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #eef2f7;
    color: #1B2A3A;
    border: 1px solid #d8e0ea;
    white-space: nowrap;
}
.wb-chip i { font-size: 0.7rem; opacity: .75; }
.wb-chip--material { background: #e8f2fb; border-color: #b8d4f0; color: #003d7a; }
.wb-chip--ewc      { background: #f3f0fb; border-color: #c9bff0; color: #4a3490; }
.wb-chip--hazardous{ background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.wb-chip--dest     { background: #f0fdf4; border-color: #86efac; color: #166534; }
.wb-chip--booking  { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.wb-chip--stockpile{ background: #f0f9ff; border-color: #7dd3fc; color: #0c4a6e; }

/* WEIGHT CAPTURE */
.wb-weight-capture {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wb-weight-trio {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

/* New weight cards */
.wb-wcard {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, border-color .2s;
}
.wb-wcard--active {
    border-color: #005EB8;
    box-shadow: 0 0 0 2px rgba(0,94,184,.15);
}
.wb-wcard--captured {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39,174,96,.12);
}
.wb-wcard--net {
    border-color: #005EB8;
    background: linear-gradient(160deg, #e8f2fb 0%, #f0f6ff 100%);
    box-shadow: 0 2px 12px rgba(0,94,184,.15);
}
.wb-wcard--net-pending {
    border-color: #dee2e6;
    background: #fafbfc;
    box-shadow: none;
}
.wb-wcard-hdr {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    background: #1B2A3A;
    color: rgba(255,255,255,.85);
}
.wb-wcard--active   .wb-wcard-hdr { background: #005EB8; }
.wb-wcard--captured .wb-wcard-hdr { background: #27ae60; }
.wb-wcard--net      .wb-wcard-hdr { background: #003d7a; color: #fff; }
.wb-wcard-body {
    padding: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 90px;
}
.wb-wcard-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1B2A3A;
    line-height: 1.1;
}
.wb-wcard-num small { font-size: 0.7rem; color: #666; font-weight: 400; }
.wb-wcard-net-num {
    font-size: 2.1rem;
    font-weight: 900;
    color: #003d7a;
    line-height: 1.05;
}
.wb-wcard-net-num small { font-size: 0.8rem; color: #555; font-weight: 400; }
.wb-wcard-net-t {
    font-size: 1rem;
    color: #005EB8;
    font-weight: 600;
    margin-top: 0.1rem;
}
.wb-wcard-live {
    font-size: 1.5rem;
    font-weight: 800;
    color: #005EB8;
    line-height: 1.1;
}
.wb-wcard-live small { font-size: 0.7rem; color: #666; font-weight: 400; }
.wb-wcard-time {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.15rem;
}
.wb-wcard-empty {
    font-size: 1.5rem;
    color: #ccc;
}

/* TICKET ACTIONS */
.wb-ticket-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

/* TODAY's TICKETS */
.wb-ticket-row {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    cursor: pointer;
    transition: background 0.15s;
}
.wb-ticket-row:hover { background: var(--bs-light, #f8f9fa); }
.wb-ticket-row.active { background: #cfe2ff; }

/* DIGITAL SIGNATURE MODAL */
.wb-sig-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 1.5rem;
}
.wb-sig-dialog {
    background: #fff;
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    margin: auto;
}
.wb-sig-header {
    background: linear-gradient(135deg, #005EB8 0%, #003d7a 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}
.wb-sig-body {
    padding: 1.5rem;
}
.wb-sig-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.wb-sig-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1rem;
    background: #fafbfc;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.wb-sig-card.captured {
    border-color: #005EB8;
    background: #e8f2fb;
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.15);
}
.wb-sig-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1B2A3A;
    font-size: 0.95rem;
}
.wb-sig-canvas-wrap {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    background: #fff;
    position: relative;
    overflow: hidden;
}
.wb-sig-canvas {
    width: 100%;
    height: 160px;
    display: block;
    cursor: crosshair;
    touch-action: none;
}
.wb-sig-preview {
    text-align: center;
    padding: 0.5rem;
}
.wb-sig-preview img {
    max-width: 100%;
    max-height: 120px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
}

@media (max-width: 768px) {
    .wb-sig-dialog {
        max-width: 100%;
    }
    .wb-sig-canvas {
        height: 180px;
    }
}
