/* JobView - ServiceBooking show page redesign
 * Page-scoped under .jv-page; AdminLTE 2.x + Bootstrap 3.3.6 base
 */

.jv-page {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* ---------- KPI strip (top: Job # / Status / Warranty / Aging) ---------- */
.jv-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.jv-kpi-tile {
    flex: 1 1 220px;
    min-width: 0;
    background: #fff;
    border: 1px solid #e6e9ee;
    border-left: 4px solid #0073b7;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.jv-kpi-tile--success { border-left-color: #00a65a; }
.jv-kpi-tile--warning { border-left-color: #f39c12; }
.jv-kpi-tile--danger  { border-left-color: #dd4b39; }
.jv-kpi-tile--muted   { border-left-color: #aaa; }
.jv-kpi-tile__icon {
    font-size: 24px;
    color: #999;
    width: 32px;
    text-align: center;
    flex: 0 0 auto;
}
.jv-kpi-tile__body { min-width: 0; flex: 1 1 auto; }
.jv-kpi-tile__label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin: 0;
}
.jv-kpi-tile__value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jv-kpi-tile__sub {
    font-size: 16px;
    color: #777;
    margin-top: 2px;
}

/* ---------- Identity strip (Customer + Device row) ---------- */
.jv-identity-strip {
    background: #fff;
    border: 1px solid #e6e9ee;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
    padding: 12px 16px;
}
.jv-identity-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
}
.jv-identity-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.jv-identity-block__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f6f9;
    color: #0073b7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 auto;
}
.jv-identity-block__label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    font-weight: 700;
    margin: 0;
}
.jv-identity-block__value {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin: 0;
}
.jv-identity-block__meta {
    font-size: 14px;
    color: #777;
}

/* ---------- Status pills ---------- */
.jv-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    border: 1px solid transparent;
    background: #f4f6f9;
    color: #555;
}
.jv-pill--success { background: #dff0d8; color: #2c662d; border-color: #c6e3c5; }
.jv-pill--danger  { background: #f2dede; color: #a94442; border-color: #ebcccc; }
.jv-pill--warning { background: #fcf3d9; color: #8a6d3b; border-color: #f2e3b3; }
.jv-pill--info    { background: #d9edf7; color: #31708f; border-color: #c4dde5; }
.jv-pill__icon { font-size: 11px; }

/* ---------- Copy button next to monospace IDs ---------- */
.jv-copy-btn {
    background: transparent;
    border: 1px solid #e6e9ee;
    color: #999;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
    transition: all 0.15s ease;
    padding: 0;
}
.jv-copy-btn:hover { color: #0073b7; border-color: #0073b7; background: #f4f9ff; }
.jv-copy-btn:active { transform: translateY(1px); }
.jv-mono { font-family: 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial; font-size: 16px; }

/* ---------- Tabs (overrides on AdminLTE nav-tabs-custom) ---------- */
.jv-page .nav-tabs-custom { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); border-radius: 4px; }
.jv-page .nav-tabs-custom > .nav-tabs > li > a { padding: 12px 16px; font-weight: 600; }
.jv-page .nav-tabs-custom > .nav-tabs > li > a > .fa,
.jv-page .nav-tabs-custom > .nav-tabs > li > a > .glyphicon { margin-right: 6px; }
.jv-page .nav-tabs-custom > .nav-tabs > li.active { border-top-color: #0073b7; }
.jv-page .nav-tabs-custom > .nav-tabs > li.active > a {
    color: #0073b7;
    border-top-width: 3px;
    margin-top: -1px;
}

/* ---------- Card overrides (AdminLTE .box gets a subtle shadow) ---------- */
.jv-page .box { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); border-top-width: 2px; }
.jv-page .box.box-primary { border-top-color: #0073b7; }
.jv-page .box-header .box-title { font-size: 15px; font-weight: 700; }
.jv-page .box-header .box-title > .fa { margin-right: 6px; color: #0073b7; }

/* ---------- Sticky table (spares + audit log) ---------- */
.jv-table-wrap {
    max-height: 480px;
    overflow: auto;
    border: 1px solid #e6e9ee;
    border-radius: 4px;
    background: #fff;
}
.jv-table-wrap--log { max-height: 360px; }
.jv-table-sticky { width: 100%; margin: 0; }
.jv-table-sticky > thead > tr > th {
    position: sticky;
    top: 0;
    background: #f4f6f9;
    color: #555;
    font-weight: 700;
    border-bottom: 2px solid #e6e9ee !important;
    z-index: 2;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.jv-table-sticky > tbody > tr > td { vertical-align: middle; font-size: 14px; }
.jv-table-sticky > tbody > tr.jv-row--current > td {
    background: #f4f9ff;
    border-left: 3px solid #0073b7;
}

/* ---------- Audit log date divider ---------- */
.jv-log-day {
    background: #fafbfc !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    font-weight: 700;
    text-align: left;
    padding: 8px 12px !important;
    border-bottom: 1px solid #e6e9ee !important;
}

/* ---------- Sticky action footer ---------- */
.jv-action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e6e9ee;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    padding: 10px 14px;
    margin: 16px -15px 0;
    z-index: 100;
}
.jv-action-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.jv-action-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-right: 12px;
    margin-right: 4px;
    border-right: 1px solid #e6e9ee;
}
.jv-action-group:last-child { border-right: 0; padding-right: 0; margin-right: 0; }
.jv-action-bar .btn { font-weight: 600; }
.jv-action-spacer { flex: 1 1 auto; }
.jv-action-bar .jv-btn-primary {
    background: #00a65a;
    border-color: #008d4c;
    color: #fff;
    font-weight: 700;
    min-width: 120px;
}
.jv-action-bar .jv-btn-primary:hover { background: #008d4c; }

/* ---------- Misc utilities ---------- */
.jv-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    font-weight: 700;
    margin: 0 0 8px;
}
.jv-warning-banner {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 4px;
    color: #856404;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}
.jv-warning-banner .fa { margin-right: 6px; }
.jv-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.jv-thumb {
    display: block;
    aspect-ratio: 4 / 3;
    border: 1px dashed #d6dae0;
    border-radius: 4px;
    overflow: hidden;
    background: #f4f6f9;
}
.jv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .jv-kpi-tile { flex-basis: calc(50% - 6px); }
}
@media (max-width: 767px) {
    .jv-kpi-tile { flex-basis: 100%; }
    .jv-kpi-tile__value { font-size: 16px; white-space: normal; }
    .jv-identity-row { flex-direction: column; align-items: flex-start; }
    .jv-action-bar { padding: 8px; }
    .jv-action-group { border-right: 0; padding-right: 0; }
    .jv-action-bar__inner > .jv-action-group { flex: 1 1 100%; }
}
