﻿/* Journal Voucher - global styles (list + form) */
.jv-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
    background: #f3f5fb;
    font-size: 0.77rem;
    color: #1f2937;
}

.jv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a2744 0%, #2d4a8a 55%, #3b6fd4 100%);
    color: #fff;
    padding: 0.42rem 0.82rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.22);
}

.jv-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.jv-topbar-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.jv-topbar-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.jv-topbar-sub {
    display: block;
    font-size: 0.65rem;
    opacity: 0.82;
    margin-top: 0.04rem;
}

.jv-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
}

.jv-btn-create {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 7px;
    padding: 0.28rem 0.72rem;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f97316;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.35);
    transition: background 0.15s, transform 0.1s;
}

.jv-btn-create:hover {
    background: #ea580c;
    color: #fff;
    transform: translateY(-1px);
}

.jv-body {
    flex: 1 1 auto;
    position: relative;
    z-index: 1;
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    padding: 0.65rem 0.7rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.jv-stats-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
}

.jv-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.jv-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
}

.jv-stat-icon--blue { background: #dbeafe; color: #1d4ed8; }
.jv-stat-icon--amber { background: #fef3c7; color: #b45309; }
.jv-stat-icon--green { background: #dcfce7; color: #15803d; }

.jv-stat-label {
    display: block;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.jv-stat-val {
    display: block;
    margin-top: 0.04rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.1;
    color: #111827;
}

.jv-filter-card,
.jv-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.jv-filter-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.45rem 0.58rem;
}

.jv-field {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.jv-field-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}

.jv-field--search { flex: 1 1 180px; }
.jv-field--date { flex: 0 1 200px; }
.jv-field--type { flex: 0 1 160px; }

.jv-search-wrap {
    position: relative;
}

.jv-search-ico {
    position: absolute;
    left: 0.42rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.78rem;
    pointer-events: none;
}

.jv-input,
.jv-select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0.3rem 0.5rem;
    font-size: 0.74rem;
    background: #fff;
    color: #1f2937;
    min-height: 30px;
}

.jv-input--search {
    padding-left: 1.55rem;
}

.jv-input:focus,
.jv-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

.jv-btn-search {
    border: none;
    border-radius: 7px;
    padding: 0.3rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1e3a5f, #2d4a8a);
    color: #fff;
    cursor: pointer;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.jv-btn-search:hover {
    filter: brightness(1.08);
}

.jv-table-card {
    overflow: hidden;
}

.jv-loading,
.jv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.78rem;
}

.jv-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b6fd4;
    border-radius: 50%;
    animation: jv-spin 0.7s linear infinite;
}

@keyframes jv-spin {
    to { transform: rotate(360deg); }
}

.jv-empty-icon {
    font-size: 1.6rem;
    color: #cbd5e1;
}

.jv-grid-wrap {
    padding: 0.2rem 0.35rem 0.45rem;
}

.jv-grid-wrap .rz-data-grid {
    border: none;
    font-size: 0.72rem;
}

.jv-grid-wrap .rz-grid-table {
    font-size: 0.72rem;
}

.jv-grid-wrap .rz-grid-table thead th {
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #475569 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.58rem !important;
    font-weight: 700 !important;
    padding: 0.28rem 0.4rem !important;
}

.jv-grid-wrap .rz-grid-table tbody td {
    padding: 0.22rem 0.4rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.jv-grid-wrap .rz-grid-table tbody tr:hover td {
    background: #f8fbff !important;
}

.jv-grid-wrap .rz-paginator {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.68rem !important;
    border-top: 1px solid #f1f5f9;
}

.jv-vno {
    font-weight: 700;
    color: #1e40af;
    font-variant-numeric: tabular-nums;
}

.jv-type-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.06rem 0.38rem;
    font-size: 0.6rem;
    font-weight: 600;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jv-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.jv-date {
    font-variant-numeric: tabular-nums;
    color: #475569;
    font-size: 0.7rem;
}

.jv-act-grp {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
}

.jv-act-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.jv-act-btn:hover {
    background: #f8fafc;
}

.jv-act-btn--edit:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.jv-act-btn--view:hover { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.jv-act-btn--del:hover { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }

@media (max-width: 768px) {
    .jv-stats-strip {
        grid-template-columns: 1fr;
    }

    .jv-topbar {
        flex-wrap: wrap;
    }
}

.jv-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
    background: #f3f5fb;
    font-size: 0.77rem;
    color: #1f2937;
    padding-bottom: 3.2rem;
}

.jv-form-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a2744 0%, #2d4a8a 55%, #3b6fd4 100%);
    color: #fff;
    padding: 0.4rem 0.82rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.22);
}

.jv-form-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.jv-form-topbar-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.jv-form-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.1;
}

.jv-form-sub {
    display: block;
    font-size: 0.62rem;
    opacity: 0.82;
    margin-top: 0.03rem;
}

.jv-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.6rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: 0.35rem;
}

.jv-btn-back {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 7px;
    padding: 0.24rem 0.62rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
}

.jv-btn-back:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.jv-form-body {
    flex: 1 1 auto;
    position: relative;
    z-index: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0.65rem 0.7rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.jv-form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    overflow: hidden;
}

.jv-meta-section {
    padding: 0.5rem 0.62rem 0.42rem;
    border-bottom: 1px solid #f1f5f9;
}

.jv-meta-grid {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) minmax(160px, 1.2fr) minmax(120px, 0.75fr) minmax(180px, 1.5fr);
    gap: 0.45rem 0.55rem;
    align-items: start;
}

.jv-meta-field {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
}

.jv-meta-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}

.jv-meta-field .form-select,
.jv-meta-field .form-control,
.jv-meta-field textarea.form-control {
    font-size: 0.74rem;
    padding: 0.28rem 0.45rem;
    min-height: 30px;
    border-radius: 7px;
    border-color: #d1d5db;
}

.jv-meta-field textarea.form-control {
    min-height: 30px;
    max-height: 56px;
    resize: vertical;
    line-height: 1.35;
}

.jv-vno-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}

.jv-vno-toggle {
    display: flex;
    align-items: center;
    padding: 0 0.35rem;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.jv-vno-toggle .rz-button {
    font-size: 0.62rem !important;
    padding: 0.15rem 0.35rem !important;
    min-height: 24px !important;
    border-radius: 5px !important;
}

.jv-vno-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 30px !important;
    font-size: 0.74rem !important;
    padding: 0.28rem 0.45rem !important;
}

.jv-vno-input:focus {
    outline: none;
    box-shadow: none !important;
}

.jv-meta-hint {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-top: 0.28rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.jv-meta-field .rz-datepicker,
.jv-meta-field .custom-datepicker {
    width: 100%;
}

.jv-meta-field .rz-inputtext {
    font-size: 0.74rem !important;
    padding: 0.28rem 0.45rem !important;
    min-height: 30px !important;
}

.jv-lines-section {
    padding: 0.35rem 0.5rem 0.45rem;
}

.jv-lines-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.32rem;
    gap: 0.4rem;
}

.jv-lines-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.jv-lines-title i {
    color: #64748b;
}

.jv-btn-add-line {
    border: 1px dashed #93c5fd;
    border-radius: 6px;
    padding: 0.18rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}

.jv-btn-add-line:hover {
    background: #dbeafe;
}

.jv-entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin-bottom: 0;
}

.jv-entries-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.56rem;
    font-weight: 700;
    padding: 0.26rem 0.35rem;
    text-align: center;
}

.jv-entries-table thead th:first-child {
    text-align: left;
}

.jv-entries-table tbody td {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.2rem 0.3rem;
    vertical-align: middle;
}

.jv-entries-table tbody tr:hover td {
    background: #fafbff;
}

.jv-entries-table tbody tr.jv-row-invalid td {
    background: #fffbeb;
}

.jv-entries-table .form-control {
    font-size: 0.72rem;
    padding: 0.2rem 0.35rem;
    min-height: 28px;
    border-radius: 6px;
    border-color: #e2e8f0;
}

.jv-entries-table .form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.jv-entries-table .inventory-input-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.jv-entries-table .form-select.custom-width {
    width: 100% !important;
    max-width: 100%;
    font-size: 0.72rem;
    padding: 0.2rem 0.35rem;
    min-height: 28px;
}

.jv-entries-table .dropdown-menu {
    font-size: 0.72rem;
    max-height: 220px;
}

.jv-entries-table .dropdown-item {
    padding: 0.22rem 0.45rem;
}

.jv-row-error {
    font-size: 0.58rem;
    color: #dc2626;
    margin-top: 0.1rem;
}

.jv-btn-del-row {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
}

.jv-btn-del-row:hover {
    background: #fef2f2;
}

.jv-empty-lines {
    text-align: center;
    color: #94a3b8;
    padding: 1.2rem 0.5rem !important;
    font-size: 0.74rem;
}

.jv-balance-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    padding: 0.4rem 0.62rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-top: 1px solid #f1f5f9;
}

.jv-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    border-radius: 7px;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.jv-balance-chip--dr { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.jv-balance-chip--cr { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }
.jv-balance-chip--ok { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.jv-balance-chip--warn { border-color: #fcd34d; color: #b45309; background: #fffbeb; }
.jv-balance-chip--err { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }

.jv-balance-hint {
    font-size: 0.62rem;
    color: #94a3b8;
    margin-left: auto;
}

.jv-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.08);
    padding: 0.38rem 0.75rem;
}

.jv-action-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.jv-action-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.jv-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475569;
}

.jv-action-pill--ok { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.jv-action-pill--err { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }

.jv-action-btns {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.jv-btn-save {
    border: none;
    border-radius: 7px;
    padding: 0.3rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    min-height: 32px;
}

.jv-btn-save:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.jv-btn-save--primary {
    background: linear-gradient(135deg, #1e3a5f, #2d4a8a);
    color: #fff;
}

.jv-btn-save--success {
    background: linear-gradient(135deg, #047857, #059669);
    color: #fff;
}

@media (max-width: 992px) {
    .jv-meta-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .jv-meta-grid {
        grid-template-columns: 1fr;
    }

    .jv-balance-hint {
        margin-left: 0;
        width: 100%;
    }
}

.jv-action-bar {
    bottom: var(--footer-height, 28px);
}

.jv-form-wrap {
    padding-bottom: calc(3.2rem + var(--footer-height, 28px));
}

