/* ==========================================================================
   Invoicer — App-specific styles
   Used alongside the main BenchMuse styles.css
   ========================================================================== */

/* ==========================================================================
   TOOLBAR (no-print controls above the invoice)
   ========================================================================== */

.inv-toolbar {
    max-width: 210mm;
    margin: 0 auto 1.25rem;
    padding: 0 1rem;
    text-align: center;
}

.inv-toolbar-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--rosewood-dark);
    margin-bottom: 0.5rem;
}

.inv-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inv-settings-blurb {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.inv-settings-blurb strong {
    color: #475569;
}

.inv-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inv-toolbar-btn:hover {
    color: #334155;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.inv-toolbar-btn i {
    width: 14px;
    height: 14px;
}

.inv-print-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: var(--rosewood-dark);
    color: var(--spruce-light);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inv-print-btn:hover {
    background: var(--rosewood-mid);
}

.inv-print-btn i {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   COLLAPSIBLE PANELS (settings, history)
   ========================================================================== */

.inv-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.inv-panel.open {
    max-height: 300px;
    opacity: 1;
}

.inv-panel-inner {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.inv-panel-label {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.inv-panel-count {
    font-size: 10px;
    color: #94a3b8;
}

/* Settings section (always visible) */
.inv-settings-section {
    max-width: 210mm;
    margin: 0 auto 1.25rem;
    padding: 0 1rem;
}

/* Settings panel controls */
.inv-settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

.inv-settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.inv-settings-label {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inv-select,
.inv-text-input,
.inv-number-input {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: #334155;
    background: white;
    outline: none;
    font-family: var(--font-body);
}

.inv-select:focus,
.inv-text-input:focus,
.inv-number-input:focus {
    border-color: var(--accent);
}

.inv-select {
    min-width: 170px;
    cursor: pointer;
}

.inv-text-input-sm {
    width: 6rem;
}

.inv-number-input-sm {
    width: 4rem;
}

.inv-backup-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.inv-backup-btn {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
    padding: 0;
}

.inv-backup-btn:hover {
    color: #334155;
}

.inv-backup-divider {
    width: 1px;
    height: 14px;
    background: #e2e8f0;
    margin: 0 0.25rem;
}

.inv-backup-btn i {
    width: 12px;
    height: 12px;
}

/* Toggle switch */
.inv-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.inv-toggle.active {
    background: var(--accent);
}

.inv-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.inv-toggle.active::after {
    transform: translateX(16px);
}

.inv-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: 32px;
}

.inv-toggle-label {
    font-size: 0.75rem;
    color: #475569;
}

/* History list */
.inv-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 250px;
    overflow-y: auto;
}

.inv-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.inv-history-row:hover {
    background: #f8fafc;
}

.inv-history-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.inv-history-id {
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 500;
    color: #64748b;
    flex-shrink: 0;
}

.inv-history-client {
    font-size: 0.75rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv-history-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.inv-history-date {
    font-size: 10px;
    color: #64748b;
}

.inv-history-total {
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
}

.inv-restore-btn {
    font-size: 10px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(226, 93, 36, 0.08);
    border: none;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s;
}

.inv-restore-btn:hover {
    color: white;
    background: var(--accent);
}

.inv-delete-btn {
    color: #cbd5e1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0;
    transition: all 0.15s;
}

.inv-history-row:hover .inv-delete-btn {
    opacity: 1;
}

.inv-delete-btn:hover {
    color: #ef4444;
}

.inv-delete-btn i {
    width: 12px;
    height: 12px;
}

.inv-empty-text {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

/* ==========================================================================
   INVOICE DOCUMENT (the printable white area)
   ========================================================================== */

.inv-document {
    max-width: 210mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 1rem;
    padding: 1.5rem;
    min-height: 297mm;
    display: flex;
    flex-direction: column;
    position: relative;
    color: #1e293b;
    font-family: var(--font-body);
}

@media (min-width: 768px) {
    .inv-document {
        padding: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .inv-document {
        padding: 3rem;
    }
}

/* --- Invoice Header --- */
.inv-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

@media (min-width: 768px) {
    .inv-header {
        flex-direction: row;
        gap: 0;
    }
}

.inv-header-left {
    width: 100%;
}

@media (min-width: 768px) {
    .inv-header-left {
        width: 50%;
        padding-right: 2rem;
    }
}

.inv-header-right {
    width: 100%;
    text-align: left;
}

@media (min-width: 768px) {
    .inv-header-right {
        width: 50%;
        text-align: right;
    }
}

/* Logo container */
.inv-logo-container {
    margin-bottom: 1.25rem;
    position: relative;
    width: 18rem;
    max-width: 100%;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 60px;
    max-height: 100px;
    border: 2px dashed #e2e8f0;
    background: transparent;
    transition: all 0.2s ease;
}

.inv-logo-container:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.inv-logo-container.has-logo {
    border: none;
    background: transparent;
}

.inv-logo-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.inv-logo-placeholder {
    text-align: center;
    color: #94a3b8;
    padding: 0.75rem 0;
}

.inv-logo-placeholder:hover {
    color: #94a3b8;
}

.inv-logo-placeholder i {
    width: 20px;
    height: 20px;
    margin: 0 auto 0.25rem;
}

.inv-logo-placeholder span {
    font-size: 0.75rem;
    font-weight: 500;
    display: block;
}

.inv-logo-preview {
    width: 100%;
    object-fit: contain;
    max-height: 100px;
    z-index: 0;
    pointer-events: none;
}

.inv-remove-logo-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 4px;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 20;
}

.inv-remove-logo-btn:hover {
    background: #dc2626;
}

.inv-remove-logo-btn i {
    width: 12px;
    height: 12px;
}

/* Editable fields */
.inv-editable {
    transition: all 0.15s ease;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: var(--font-body);
}

.inv-editable:hover {
    border-color: #e2e8f0;
    background-color: #f8fafc;
}

.inv-editable:focus {
    border-color: var(--accent);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(226, 93, 36, 0.2);
}

/* Business info */
.inv-business-name {
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0.25rem;
    margin-left: -0.25rem;
    margin-bottom: 0.125rem;
}

.inv-business-name::placeholder {
    color: #94a3b8;
}

.inv-business-fields {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.875rem;
    color: #475569;
}

.inv-business-field {
    width: 100%;
    padding: 0.125rem;
    margin-left: -0.125rem;
}

/* Invoice title & meta */
.inv-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 300;
    color: #e2e8f0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.inv-meta-fields {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

@media (min-width: 768px) {
    .inv-meta-fields {
        align-items: flex-end;
    }
}

.inv-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inv-meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inv-meta-input {
    width: 7rem;
    text-align: right;
    font-weight: 500;
    font-size: 0.875rem;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

/* --- Bill To / Job Details --- */
.inv-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .inv-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

.inv-section-label {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.inv-client-fields {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.inv-client-name {
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
    padding: 0.125rem;
    margin-left: -0.125rem;
}

.inv-client-name::placeholder {
    color: #94a3b8;
}

.inv-client-field {
    width: 100%;
    font-size: 0.875rem;
    color: #475569;
    padding: 0.125rem;
    margin-left: -0.125rem;
}

.inv-client-field::placeholder {
    color: #94a3b8;
}

.inv-client-field.inv-address {
    color: #64748b;
}

/* Job / Instrument details */
.inv-job-box {
    background: rgba(248, 250, 252, 0.7);
    padding: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #f1f5f9;
}

.inv-instrument-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 0.75rem;
}

.inv-field-group {
    position: relative;
}

.inv-field-label {
    display: block;
    width: 100%;
    font-size: 9px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.125rem;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
    font-family: var(--font-body);
}

.inv-field-value {
    width: 100%;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.inv-field-remove {
    position: absolute;
    right: -6px;
    top: 0;
    color: #cbd5e1;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
    padding: 0;
}

.inv-field-group:hover .inv-field-remove {
    opacity: 1;
}

.inv-field-remove:hover {
    color: #ef4444;
}

.inv-field-remove i {
    width: 12px;
    height: 12px;
}

.inv-add-detail-btn {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.inv-add-detail-btn:hover {
    color: #c2410c;
}

.inv-add-detail-btn i {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   LINE ITEMS TABLE
   ========================================================================== */

.inv-table-wrap {
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.inv-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
}

.inv-table thead tr {
    border-bottom: 2px solid #1e293b;
}

.inv-table th {
    padding: 0.5rem 0;
    font-size: 10px;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.inv-table th:nth-child(1) {
    text-align: left;
    width: 50%;
}

.inv-table th:nth-child(2) {
    text-align: center;
    width: 15%;
}

.inv-table th:nth-child(3) {
    text-align: right;
    width: 15%;
}

.inv-table th:nth-child(4) {
    text-align: right;
    width: 15%;
}

.inv-table th:nth-child(5) {
    width: 5%;
}

.inv-table .item-row {
    border-bottom: 1px solid #f1f5f9;
}

.inv-table .item-row td {
    padding: 0.375rem 0;
    vertical-align: middle;
}

.inv-table .desc-field {
    width: 100%;
    font-size: 0.875rem;
    color: #334155;
    padding: 0.375rem;
    resize: none;
    overflow: hidden;
    min-height: 28px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-body);
}

.inv-table .qty-input,
.inv-table .rate-input {
    width: 100%;
    font-size: 0.875rem;
    color: #334155;
    padding: 0.375rem;
    font-family: var(--font-body);
}

.inv-table .qty-input {
    text-align: center;
}

.inv-table .rate-input {
    text-align: right;
}

.inv-table .amount-display {
    text-align: right;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    padding-right: 0.25rem;
}

.inv-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.inv-table .item-row:hover .inv-item-actions {
    opacity: 1;
}

.inv-item-action-btn {
    color: #cbd5e1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: color 0.15s;
}

.inv-item-action-btn:hover {
    color: var(--accent);
}

.inv-item-action-btn.inv-delete:hover {
    color: #ef4444;
}

.inv-item-action-btn i {
    width: 12px;
    height: 12px;
}

.inv-add-item-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
    transition: color 0.15s;
}

.inv-add-item-btn:hover {
    color: #c2410c;
}

.inv-add-item-btn i {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   PRESETS
   ========================================================================== */

.inv-presets {
    margin-bottom: 2rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.inv-presets-container {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.inv-presets-label {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 0.25rem;
}

.inv-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #475569;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.inv-preset-chip:hover {
    background: rgba(226, 93, 36, 0.06);
    border-color: rgba(226, 93, 36, 0.3);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(226, 93, 36, 0.08);
}

.inv-preset-chip:active {
    transform: translateY(0);
}

.inv-customize-btn {
    font-size: 10px;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    margin-top: 0.375rem;
    transition: color 0.15s;
}

.inv-customize-btn:hover {
    color: #64748b;
}

.inv-customize-btn i {
    width: 10px;
    height: 10px;
}

/* Preset editor */
.inv-preset-editor {
    margin-top: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
}

.inv-preset-editor-title {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.inv-preset-edit-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.inv-preset-edit-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inv-preset-edit-input {
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: #334155;
}

.inv-preset-edit-label {
    width: 6rem;
}

.inv-preset-edit-desc {
    flex: 1;
}

.inv-preset-edit-rate {
    width: 4rem;
    text-align: right;
}

.inv-preset-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.inv-add-preset-btn {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
}

.inv-add-preset-btn:hover {
    color: #c2410c;
}

.inv-done-btn {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}

.inv-done-btn:hover {
    color: #334155;
}

/* ==========================================================================
   TOTALS
   ========================================================================== */

.inv-totals-wrap {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .inv-totals-wrap {
        justify-content: flex-end;
    }
}

.inv-totals {
    width: 100%;
}

@media (min-width: 768px) {
    .inv-totals {
        width: 40%;
    }
}

.inv-subtotal-row,
.inv-tax-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.inv-subtotal-label,
.inv-tax-label-wrap {
    font-size: 0.875rem;
    color: #64748b;
}

.inv-tax-label-wrap {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.inv-tax-rate-text {
    font-size: 10px;
    color: #94a3b8;
}

.inv-subtotal-value,
.inv-tax-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.inv-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-top: 0.25rem;
    border-top: 2px solid #1e293b;
}

.inv-total-label,
.inv-total-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

/* ==========================================================================
   INVOICE FOOTER (notes, business name)
   ========================================================================== */

.inv-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.inv-notes-textarea {
    width: 100%;
    font-size: 0.875rem;
    color: #64748b;
    background: rgba(248, 250, 252, 0.5);
    border: 1px solid #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.75rem;
    height: 5rem;
    resize: none;
    font-family: var(--font-body);
}

.inv-footer-credit {
    font-size: 11px;
    color: #cbd5e1;
    margin-top: 1rem;
}

.inv-footer-credit .inv-business-ref {
    font-weight: 500;
    color: #94a3b8;
}

/* Print hint */
.inv-print-hint {
    text-align: center;
    padding: 1rem 0;
    font-size: 10px;
    color: #cbd5e1;
}

/* ==========================================================================
   UTILITY
   ========================================================================== */

.hidden {
    display: none !important;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 0;
        padding: 0;
    }

    /* Hide site chrome */
    benchmuse-header,
    benchmuse-footer,
    .tool-page-hero,
    .inv-toolbar,
    .inv-print-hint {
        display: none !important;
    }

    /* Flatten tool content section */
    .tool-content-section {
        padding: 0 !important;
    }

    .tool-content-section .bg-wood {
        display: none !important;
    }

    @page {
        size: A4;
        margin: 15mm 15mm 10mm 15mm;
    }

    .inv-document {
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        min-height: 0;
    }

    input,
    textarea {
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        resize: none;
        box-shadow: none !important;
        outline: none !important;
    }

    input[type=number]::-webkit-inner-spin-button,
    input[type=number]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    input[type=number] {
        -moz-appearance: textfield;
        appearance: textfield;
    }

    input[type=date]::-webkit-calendar-picker-indicator {
        display: none;
        -webkit-appearance: none;
    }

    ::placeholder {
        color: transparent;
    }

    .inv-logo-container {
        border: none !important;
        min-height: 0 !important;
    }

    #logo-placeholder {
        display: none !important;
    }

    .desc-field {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .inv-header {
        flex-direction: row;
        gap: 0;
    }

    .inv-header-left {
        width: 50%;
        padding-right: 2rem;
    }

    .inv-header-right {
        width: 50%;
        text-align: right;
    }

    .inv-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    .inv-meta-fields {
        align-items: flex-end;
    }

    .inv-totals-wrap {
        justify-content: flex-end;
    }

    .inv-totals {
        width: 40%;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    .inv-table thead {
        display: none;
    }

    .inv-table,
    .inv-table tbody,
    .inv-table tr,
    .inv-table td {
        display: block;
        width: 100%;
    }

    .inv-table {
        min-width: 0 !important;
    }

    .inv-table .item-row {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 8px;
        background: #f8fafc;
        position: relative;
    }

    .inv-table .item-row td {
        padding: 2px 0;
        border: none;
    }

    .inv-table .item-row td:nth-child(1) {
        margin-bottom: 6px;
    }

    .inv-table .item-row td:nth-child(2),
    .inv-table .item-row td:nth-child(3),
    .inv-table .item-row td:nth-child(4) {
        display: inline-block;
        width: 33%;
    }

    .inv-table .item-row td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #94a3b8;
        margin-bottom: 2px;
    }

    .inv-table .item-row td:nth-child(5) {
        position: absolute;
        top: 8px;
        right: 8px;
        width: auto;
    }

    .inv-table .item-row td:nth-child(5) .inv-item-actions {
        opacity: 1;
    }

    .inv-presets-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
}