/* Global dark mode overrides for Tailwind utility-heavy markup */
html.dark body {
    background-color: #0b1220;
    color: #e5e7eb;
}

html.dark .bg-gray-100 {
    background-color: #0b1220 !important;
}

html.dark .bg-white {
    background-color: #111827 !important;
}

html.dark .bg-gray-50 {
    background-color: #1f2937 !important;
}

html.dark .bg-gray-200 {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

html.dark .bg-pink-50 {
    background-color: #3b1c31 !important;
}

html.dark .bg-green-100 {
    background-color: #123224 !important;
}

html.dark .bg-blue-100 {
    background-color: #1a2d52 !important;
}

html.dark .bg-red-100 {
    background-color: #4a1b1b !important;
}

html.dark .text-gray-400 {
    color: #9ca3af !important;
}

html.dark .text-gray-500 {
    color: #9ca3af !important;
}

html.dark .text-gray-600 {
    color: #d1d5db !important;
}

html.dark .text-gray-700 {
    color: #e5e7eb !important;
}

html.dark .text-pink-600 {
    color: #f9a8d4 !important;
}

html.dark .text-green-700 {
    color: #86efac !important;
}

html.dark .text-blue-700 {
    color: #93c5fd !important;
}

html.dark .text-red-700 {
    color: #fca5a5 !important;
}

html.dark .border,
html.dark .border-b,
html.dark .border-t,
html.dark .divide-y> :not([hidden])~ :not([hidden]) {
    border-color: #374151 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
    -webkit-appearance: none;
    appearance: none;
    background-color: #0f172a;
    color: #f9fafb;
    border-color: #4b5563;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #94a3b8;
}

html.dark .hover\:bg-gray-50:hover {
    background-color: #1f2937 !important;
}

html.dark .hover\:bg-gray-300:hover {
    background-color: #4b5563 !important;
}

html.dark .hover\:bg-red-50:hover {
    background-color: #3b1016 !important;
}

html.dark .shadow,
html.dark .shadow-lg,
html.dark .shadow-xl,
html.dark .shadow-2xl {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 24px rgba(0, 0, 0, .25) !important;
}

html.dark table {
    color: #e5e7eb;
}

.theme-toggle-btn {
    width: 100%;
    text-align: left;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: background-color .2s ease;
}

html.dark .theme-toggle-btn {
    color: #e5e7eb;
}

html.dark .theme-toggle-btn:hover {
    background-color: #1f2937;
}

/* Remove Safari default input styling */
input,
select,
textarea {
    -webkit-appearance: none;
    appearance: none;
}

/* Invoice line item table layout */

/* Invoice line item table layout */
.line-items-table {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #ffffff;
}

.line-items-head,
.line-item-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(320px, 2.9fr) minmax(72px, 0.5fr) minmax(100px, 0.8fr) minmax(72px, 0.5fr) minmax(78px, 0.45fr);
    gap: 0.5rem;
    align-items: center;
}

.line-items-head {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.65rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #4b5563;
}

.line-item-row {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.65rem 0.75rem;
    background: #ffffff;
}

.line-item-row:last-child {
    border-bottom: 0;
}

.line-item-cell input,
.line-item-cell select {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
}

.line-item-cell.remove-cell {
    text-align: right;
}

.invoice-remove-row {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
}

.invoice-remove-row:hover {
    color: #b91c1c;
}

@media (max-width: 767px) {
    .line-items-head {
        display: none;
    }

    .line-item-row {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .line-item-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
        font-weight: 700;
        color: #6b7280;
        text-transform: uppercase;
    }

    .line-item-cell.remove-cell {
        text-align: left;
    }
}

html.dark .line-items-table {
    background: #111827;
    border-color: #374151;
}

html.dark .line-items-head {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}

html.dark .line-item-row {
    background: #111827;
    border-color: #374151;
}

html.dark .line-item-cell::before {
    color: #9ca3af;
}