/* Base Resets & Input styling */
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;
}

/* Custom properties & utility classes */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* Ghost Input: Transparent, adapts to container */
.ghost-input {
    background: transparent;
    border: 1px solid transparent;
    outline: none;
    transition: all 0.2s ease;
}

.ghost-input:focus,
.ghost-input:hover {
    background: rgba(15, 23, 42, 0.5);
    /* surface focus */
    border-color: #334155;
    border-radius: 0.25rem;
}

.ghost-input::placeholder {
    color: #475569;
    /* slate-600 */
}

/* Print Only Classes (Hidden in screen mode) */
.print-only-inline {
    display: none;
}

/* Document Canvas Container */
.document-canvas {
    transform-origin: top center;
}

/* 
  Print Stylesheet 
  Inverts the dark mode onto paper, saves ink, looks professional.
*/
@media print {

    /* Hard reset background to white for the entire page */
    @page {
        margin: 0.5cm;
    }

    html,
    body,
    .print-page,
    .print-page-container {
        background: white !important;
        color: black !important;
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide UI elements */
    .print-hide {
        display: none !important;
    }

    .print-hide-input {
        display: none !important;
    }

    .print-only-inline {
        display: inline-block !important;
    }

    /* Convert Document Canvas to A4 style */
    .print-card {
        max-width: none !important;
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        margin: 0 !important;
        padding: 1cm !important;
    }

    /* Text Color Inversions */
    .text-white,
    .text-slate-300 {
        color: #000 !important;
        font-weight: 500;
    }

    .text-slate-400,
    .text-slate-500 {
        color: #475569 !important;
    }

    .text-primary-400,
    .text-primary-500,
    .text-primary-600 {
        color: #4f46e5 !important;
    }

    /* darker indigo */

    /* Ghost inputs become plain text */
    .ghost-input {
        border: none !important;
        background: transparent !important;
        color: inherit !important;
        padding: 0 !important;
        resize: none !important;
    }

    /* Background inversions */
    .bg-surface,
    .bg-panel {
        background: white !important;
    }

    .print-bg-light {
        background: #f8fafc !important;
    }

    /* slate-50 */
    .print-border-dark {
        border-color: #cbd5e1 !important;
        border-width: 1px !important;
    }

    .border-border,
    .divide-border>* {
        border-color: #cbd5e1 !important;
    }

    /* Fix Textarea auto height for print */
    textarea {
        height: auto !important;
        overflow: visible !important;
        white-space: pre-wrap !important;
        padding: 0 !important;
        border: none !important;
    }

    /* Hide delete buttons on lines */
    .btn-remove-item {
        display: none !important;
    }
}