/* =========================================================
   Tools CSS — ZeroBillBook
   Hub cards, calculator, invoice generator, HSN finder
   ========================================================= */

/* ── Hub page ─────────────────────────────────────────── */

.tools-hub-page .tools-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem 1.25rem;
    margin-top: 1.5rem;
}

.tools-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(32, 75, 123, 0.1);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    box-shadow: 0 2px 8px rgba(32, 75, 123, 0.05);
}

.tools-trust-pill i {
    color: var(--primary-color, #204B7B);
    font-size: 0.95rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    padding: 1.75rem;
    border: 1px solid rgba(32, 75, 123, 0.08);
    box-shadow: 0 8px 32px rgba(32, 75, 123, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #204B7B), #3b82f6);
    opacity: 0.85;
    transition: opacity 0.25s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(32, 75, 123, 0.14);
    border-color: rgba(32, 75, 123, 0.18);
    color: inherit;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card-icon-wrap {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(32, 75, 123, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
    color: var(--primary-color, #204B7B);
    font-size: 1.6rem;
    margin-bottom: 1.1rem;
    transition: transform 0.25s ease;
}

.tool-card:hover .tool-card-icon-wrap {
    transform: scale(1.06);
}

.tool-card-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
}

.tool-card-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #0f172a);
}

.tool-card-desc {
    font-size: 0.92rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.25rem;
}

.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.tool-card-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    background: rgba(32, 75, 123, 0.05);
    border: 1px solid rgba(32, 75, 123, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
}

.tool-card-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color, #204B7B);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.tool-card:hover .tool-card-cta {
    gap: 0.6rem;
}

.tool-notice {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(32, 75, 123, 0.06) 100%);
    border: 1px solid rgba(32, 75, 123, 0.1);
    max-width: 720px;
    margin: 0 auto;
}

.tool-notice i {
    font-size: 1.25rem;
    color: var(--primary-color, #204B7B);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.tool-notice strong {
    color: var(--text-primary, #0f172a);
}

.tool-notice span,
.tool-notice div {
    font-size: 0.92rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.55;
}

/* ── Tool detail pages ────────────────────────────────── */

.tool-page-hero {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tool-page-hero .tool-page-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(32, 75, 123, 0.12) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--primary-color, #204B7B);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(32, 75, 123, 0.1);
}

.tool-page-body {
    position: relative;
    z-index: 1;
    padding-bottom: 3rem;
}

.tool-page-body .container-narrow {
    max-width: 900px;
}

.tool-page-body .container-wide {
    max-width: 960px;
}

/* Panels */
.tool-panel {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(32, 75, 123, 0.07);
    padding: 1.5rem 1.75rem;
    border: 1px solid rgba(32, 75, 123, 0.08);
    height: 100%;
}

.tool-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color, #204B7B);
    border-bottom: 2px solid rgba(32, 75, 123, 0.08);
    padding-bottom: 0.65rem;
    margin-bottom: 1.25rem;
}

.tool-panel-title i {
    font-size: 1.1rem;
    opacity: 0.85;
}

.tool-form-group {
    margin-bottom: 1.25rem;
}

.tool-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #334155);
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

.tool-panel .form-control,
.tool-panel .form-select {
    border: 1px solid rgba(32, 75, 123, 0.15);
    border-radius: 0.65rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-panel .form-control:focus,
.tool-panel .form-select:focus {
    border-color: var(--primary-color, #204B7B);
    box-shadow: 0 0 0 3px rgba(32, 75, 123, 0.12);
}

.tool-panel .form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
}

/* Segmented controls */
.tool-segment {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.tool-segment .btn-check + .btn {
    flex: 1;
    border-radius: 0.65rem !important;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.5rem;
    border: 1px solid rgba(32, 75, 123, 0.15);
    color: var(--text-secondary, #64748b);
    background: #fff;
    white-space: normal;
    line-height: 1.3;
}

.tool-segment .btn-check:checked + .btn {
    background: var(--primary-color, #204B7B);
    border-color: var(--primary-color, #204B7B);
    color: #fff;
    box-shadow: 0 4px 12px rgba(32, 75, 123, 0.25);
}

.tool-calc-btn {
    border-radius: 0.75rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 16px rgba(32, 75, 123, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(32, 75, 123, 0.28);
}

/* Results panel */
.tool-result-panel {
    background: linear-gradient(160deg, rgba(248, 250, 255, 0.98) 0%, rgba(239, 245, 255, 0.95) 100%);
    border-color: rgba(32, 75, 123, 0.12);
}

.tool-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary, #94a3b8);
}

.tool-empty-state i {
    font-size: 3rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 0.75rem;
}

.tool-empty-state p {
    margin: 0;
    font-size: 0.92rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(32, 75, 123, 0.07);
    font-size: 0.9rem;
}

.result-row span {
    color: var(--text-secondary, #64748b);
}

.result-row strong {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.result-row.result-total {
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 2px solid rgba(32, 75, 123, 0.12);
    border-bottom: none;
}

.result-row.result-total strong {
    color: var(--primary-color, #204B7B);
}

.result-row.result-grand {
    padding: 0.85rem 0 0.25rem;
    border-top: 2px solid var(--primary-color, #204B7B);
    border-bottom: none;
}

.result-row.result-grand span {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary, #0f172a);
}

.result-row.result-grand strong {
    font-size: 1.3rem;
    color: var(--primary-color, #204B7B);
    font-weight: 800;
}

/* Reference table */
.tool-ref-section {
    margin-top: 2.5rem;
}

.tool-ref-section h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-bottom: 1rem;
}

.tool-ref-table-wrap {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid rgba(32, 75, 123, 0.1);
    background: #fff;
    box-shadow: 0 4px 20px rgba(32, 75, 123, 0.05);
}

.tool-ref-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tool-ref-table thead th {
    background: var(--primary-color, #204B7B);
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.tool-ref-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(32, 75, 123, 0.06);
    vertical-align: middle;
    color: var(--text-secondary, #475569);
}

.tool-ref-table tbody tr:last-child td {
    border-bottom: none;
}

.tool-ref-table tbody tr:hover td {
    background: rgba(32, 75, 123, 0.03);
}

.tool-ref-note {
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.75rem;
    line-height: 1.55;
}

/* Rate badges */
.gst-rate-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 0.4rem;
    white-space: nowrap;
}

.gst-rate-0   { background: rgba(16, 185, 129, 0.15); color: #059669; }
.gst-rate-5   { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.gst-rate-18  { background: rgba(245, 158, 11, 0.18); color: #d97706; }
.gst-rate-40  { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.gst-rate-sp  { background: rgba(100, 116, 139, 0.15); color: #475569; }

/* HSN finder */
.tool-search-wrap {
    position: relative;
    margin-bottom: 1.5rem;
}

.tool-search-wrap i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #94a3b8);
    font-size: 1.15rem;
    pointer-events: none;
}

.tool-search-wrap .form-control {
    padding-left: 2.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(32, 75, 123, 0.12);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(32, 75, 123, 0.06);
    font-size: 1rem;
    height: 3.25rem;
}

.tool-search-wrap .form-control:focus {
    border-color: var(--primary-color, #204B7B);
    box-shadow: 0 4px 24px rgba(32, 75, 123, 0.12), 0 0 0 3px rgba(32, 75, 123, 0.1);
}

.tool-warning-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1.1rem;
    border-radius: 0.85rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.55;
}

.tool-warning-notice i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #d97706;
}

#hsnTable {
    margin: 0;
    border-collapse: collapse;
}

#hsnTable thead th {
    background: var(--primary-color, #204B7B);
    color: #fff;
    font-weight: 600;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    border: none;
}

#hsnTable tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(32, 75, 123, 0.06);
}

#hsnTable tbody tr:hover td {
    background: rgba(32, 75, 123, 0.03);
}

#hsnTable code {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color, #204B7B);
    background: rgba(32, 75, 123, 0.07);
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
}

#hsnCount {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 0.75rem;
}

.hsn-cat-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    background: rgba(32, 75, 123, 0.05);
    border: 1px solid rgba(32, 75, 123, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
}

/* Invoice generator — full redesign */
.invoice-gen-page .container-inv {
    max-width: 1140px;
}

.inv-tax-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    background: rgba(32, 75, 123, 0.06);
    border: 1px solid rgba(32, 75, 123, 0.1);
    color: var(--text-secondary, #64748b);
}

.inv-tax-banner.is-intra {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

.inv-tax-banner.is-inter {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.inv-tax-banner.is-pending {
    background: rgba(100, 116, 139, 0.06);
    border-color: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.inv-step-card {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(32, 75, 123, 0.08);
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(32, 75, 123, 0.05);
}

.inv-step-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inv-step-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color, #204B7B);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.inv-step-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
}

.inv-step-sub {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
}

.inv-field {
    margin-bottom: 0.85rem;
}

.inv-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.inv-field .form-control,
.inv-field .form-select {
    border: 1px solid rgba(32, 75, 123, 0.14);
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inv-field .form-control:focus,
.inv-field .form-select:focus {
    border-color: var(--primary-color, #204B7B);
    box-shadow: 0 0 0 3px rgba(32, 75, 123, 0.1);
}

.inv-field .form-control.gstin-input {
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

/* Line items grid */
.inv-items-wrap {
    border: 1px solid rgba(32, 75, 123, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.inv-items-head {
    display: none;
    grid-template-columns: 1fr 72px 56px 88px 64px 36px;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: rgba(32, 75, 123, 0.06);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #64748b);
}

@media (min-width: 768px) {
    .inv-items-head {
        display: grid;
    }
}

.inv-item-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(32, 75, 123, 0.06);
    align-items: end;
}

@media (min-width: 768px) {
    .inv-item-row {
        grid-template-columns: 1fr 72px 56px 88px 64px 36px;
        padding: 0.55rem 0.75rem;
        align-items: center;
    }
}

.inv-item-row:first-child {
    border-top: none;
}

.inv-item-row .form-control,
.inv-item-row .form-select {
    border: 1px solid rgba(32, 75, 123, 0.12);
    border-radius: 0.5rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.88rem;
}

.inv-item-row .form-control:focus,
.inv-item-row .form-select:focus {
    border-color: var(--primary-color, #204B7B);
    box-shadow: 0 0 0 2px rgba(32, 75, 123, 0.1);
}

.inv-item-mobile-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

@media (min-width: 768px) {
    .inv-item-mobile-label {
        display: none;
    }
}

.inv-item-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    cursor: pointer;
    transition: background 0.2s;
}

.inv-item-remove:hover {
    background: rgba(239, 68, 68, 0.12);
}

.inv-add-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.6rem;
    border: 1px dashed rgba(32, 75, 123, 0.25);
    background: transparent;
    color: var(--primary-color, #204B7B);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.inv-add-item-btn:hover {
    background: rgba(32, 75, 123, 0.05);
    border-color: rgba(32, 75, 123, 0.4);
}

/* Live totals strip */
.inv-totals-strip {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(32, 75, 123, 0.06) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(32, 75, 123, 0.1);
}

.inv-totals-strip.is-visible {
    display: grid;
}

.inv-total-cell {
    text-align: center;
}

.inv-total-cell span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.2rem;
}

.inv-total-cell strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color, #204B7B);
}

.inv-total-cell.grand strong {
    font-size: 1.2rem;
}

/* Action bar */
.inv-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.25rem 0 0.5rem;
}

.inv-action-bar .btn-primary {
    flex: 1;
    min-width: 160px;
}

/* Preview panel */
.inv-preview-wrap {
    position: sticky;
    top: 5.5rem;
}

.inv-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.inv-preview-header h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
}

.inv-preview-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.inv-preview-paper {
    background: #fff;
    border-radius: 0.85rem;
    border: 1px solid rgba(32, 75, 123, 0.1);
    box-shadow: 0 12px 40px rgba(32, 75, 123, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 420px;
    overflow: hidden;
    position: relative;
}

.inv-preview-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #204B7B), #3b82f6);
}

.inv-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.inv-preview-empty i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
}

.inv-preview-empty p {
    font-size: 0.88rem;
    margin: 0 0 1rem;
    max-width: 220px;
    line-height: 1.5;
}

.inv-preview-skeleton {
    width: 100%;
    max-width: 200px;
    opacity: 0.4;
}

.inv-preview-skeleton span {
    display: block;
    height: 8px;
    background: rgba(32, 75, 123, 0.15);
    border-radius: 4px;
    margin-bottom: 8px;
}

.inv-preview-skeleton span:nth-child(1) { width: 80%; }
.inv-preview-skeleton span:nth-child(2) { width: 60%; }
.inv-preview-skeleton span:nth-child(3) { width: 90%; }

#invPreviewContent {
    padding: 0;
    font-size: 0.82rem;
    overflow-x: auto;
}

/* Invoice document (preview + print) */
.inv-doc {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 12px;
    color: #1e293b;
    padding: 1.25rem;
    line-height: 1.45;
}

.inv-doc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--primary-color, #204B7B);
}

.inv-doc-biz-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color, #204B7B);
    margin: 0 0 0.25rem;
}

.inv-doc-meta {
    font-size: 10px;
    color: #64748b;
    margin: 0.1rem 0;
}

.inv-doc-title-block {
    text-align: right;
}

.inv-doc-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color, #204B7B);
    margin: 0 0 0.35rem;
    letter-spacing: 0.05em;
}

.inv-doc-type {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
}

.inv-doc-type.intra {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.inv-doc-type.inter {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.inv-doc-billto {
    background: rgba(32, 75, 123, 0.04);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 11px;
}

.inv-doc-billto strong {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.inv-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.85rem;
    font-size: 10px;
}

.inv-doc-table thead th {
    background: var(--primary-color, #204B7B);
    color: #fff;
    padding: 0.45rem 0.4rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.inv-doc-table thead th.num {
    text-align: right;
}

.inv-doc-table tbody td {
    padding: 0.4rem;
    border-bottom: 1px solid rgba(32, 75, 123, 0.08);
    vertical-align: top;
}

.inv-doc-table tbody td.num {
    text-align: right;
    white-space: nowrap;
}

.inv-doc-table tbody tr:nth-child(even) td {
    background: rgba(32, 75, 123, 0.02);
}

.inv-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.inv-doc-tax-table {
    flex: 1;
    min-width: 180px;
    border-collapse: collapse;
    font-size: 9px;
}

.inv-doc-tax-table th,
.inv-doc-tax-table td {
    padding: 0.3rem 0.4rem;
    border: 1px solid rgba(32, 75, 123, 0.1);
}

.inv-doc-tax-table thead th {
    background: rgba(32, 75, 123, 0.06);
    font-weight: 600;
}

.inv-doc-totals {
    min-width: 160px;
    text-align: right;
}

.inv-doc-totals p {
    margin: 0.2rem 0;
    font-size: 11px;
    color: #64748b;
}

.inv-doc-totals .grand {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-color, #204B7B);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 2px solid var(--primary-color, #204B7B);
}

.inv-doc-watermark {
    text-align: center;
    font-size: 9px;
    color: #94a3b8;
    margin-top: 1rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(32, 75, 123, 0.08);
}

@media (max-width: 991px) {
    .inv-preview-wrap {
        position: static;
    }

    .inv-totals-strip {
        grid-template-columns: 1fr;
    }

    .inv-totals-strip.is-visible {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .inv-step-card {
        padding: 1rem;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .tool-preview-panel {
        position: static;
    }

    .tool-segment {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .tool-card {
        padding: 1.35rem;
    }

    .tool-panel {
        padding: 1.25rem;
    }
}
