/* ==================================================== */
/* INVOICE GENERATOR SPECIFIC STYLES - CLEAN & PREMIUM UI */
/* ==================================================== */

:root {
    --invoice-primary: #0ea5e9;
    --invoice-primary-hover: #0284c7;
    --invoice-dark: #0f172a;
    --invoice-border: #e2e8f0;
    --invoice-bg: #f8fafc;
    --invoice-card-bg: #ffffff;
    --invoice-text-main: #334155;
    --invoice-text-muted: #64748b;
    --invoice-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --invoice-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Badge styling for top nav */
.badge-test {
    background-color: #f59e0b;
    color: #ffffff;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 9999px;
    margin-left: 10px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Sidebar layout & visual structure */
.invoice-sidebar {
    width: 480px !important;
    flex-shrink: 0;
    background-color: var(--invoice-bg);
    border-right: 1px solid var(--invoice-border);
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
}

.invoice-sidebar::-webkit-scrollbar {
    width: 6px;
}
.invoice-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.invoice-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.invoice-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.invoice-sidebar .card {
    background: var(--invoice-card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--invoice-shadow);
    border: 1px solid var(--invoice-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invoice-sidebar .card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--invoice-dark);
    margin-bottom: 0;
    border-bottom: 2px solid var(--invoice-border);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Collapsible sections styled as clean accordion cards */
.collapsible-section {
    border: 1px solid var(--invoice-border);
    border-radius: 8px;
    background: var(--invoice-card-bg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.collapsible-section[open] {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.collapsible-section summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--invoice-dark);
    padding: 14px 16px;
    background: var(--invoice-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
    user-select: none;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

/* Arrow indicator icon */
.collapsible-section summary::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--invoice-text-muted);
    border-bottom: 2px solid var(--invoice-text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.collapsible-section[open] summary::after {
    transform: rotate(-135deg);
}

.collapsible-section[open] summary {
    border-bottom: 1px solid var(--invoice-border);
}

.collapsible-section .grid-2-col {
    padding: 16px;
    margin: 0;
}

/* Premium Drag & Drop upload container */
.file-upload-wrapper {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: var(--invoice-bg);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    padding: 20px 16px;
}

.file-upload-wrapper:hover {
    border-color: var(--invoice-primary);
    background: #f0f9ff;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--invoice-text-main);
}

.file-upload-label::before {
    content: '📥';
    font-size: 1.8rem;
}

/* Form Helper Typography */
.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--invoice-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.help-text {
    font-size: 0.8rem;
    color: var(--invoice-text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Edit Items Grid / Table UI */
.table-scroll-wrapper {
    border: 1px solid var(--invoice-border);
    border-radius: 6px;
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
    background: var(--invoice-bg);
}

.edit-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.edit-items-table th {
    background: #f1f5f9;
    padding: 10px;
    font-weight: 600;
    color: var(--invoice-text-main);
    border-bottom: 1px solid var(--invoice-border);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
}

.edit-items-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--invoice-border);
    background: var(--invoice-card-bg);
}

.edit-items-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--invoice-dark);
    transition: all 0.15s ease;
}

.edit-items-table input:focus {
    outline: none;
    border-color: var(--invoice-primary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--invoice-text-muted);
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Button enhancements */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
}
.btn-danger:hover {
    background-color: #dc2626 !important;
}

.btn-primary {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover {
    background-color: #0369a1 !important;
}

.btn-secondary {
    background-color: #ffffff !important;
    border: 1px solid var(--invoice-border) !important;
    color: var(--invoice-text-main) !important;
}
.btn-secondary:hover {
    background-color: var(--invoice-bg) !important;
    border-color: #cbd5e1 !important;
}

/* Preview Display Workspace styling */
.invoice-preview-area {
    background-color: #475569 !important; /* Premium dark slate background to make paper stand out */
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 30px !important;
}

.invoice-sheet-container {
    width: auto;
}

/* ==================================================== */
/* INVOICE PAPER PRESENTATION LAYOUT */
/* ==================================================== */
.invoice-pdf-document {
    background: #ffffff;
    color: #000000;
    width: 8.5in;
    min-height: 10in;
    padding: 0.25in 0.75in;
    box-sizing: border-box;
    box-shadow: var(--invoice-shadow-lg);
    font-family: 'Glacial Indifference', 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
    font-size: 13.5px;
    line-height: 1.45;
}

/* Header Grid */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

/* Left Brand Details */
.invoice-logo-block {
    text-align: center;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invoice-company-title {
    font-family: 'Glacial Indifference', 'Glacial Impact', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569; /* Slate gray */
    letter-spacing: 1.5px;
    line-height: 1.2;
    text-transform: uppercase;
    margin-top: 2px;
}

.invoice-brand-subtitle {
    font-size: 44px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 4px;
    line-height: 1.0;
}

.invoice-company-address {
    font-family: 'Glacial Indifference', 'Glacial Impact', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b; /* Slate gray/light gray */
    letter-spacing: 0.5px;
    margin-top: 2px;
}



.brand-part-career {
    color: #1025a1;
    font-weight: 400;
}

.brand-part-legends {
    color: #00a8a8;
    font-weight: 400;
}

/* Right Contact details block */
.invoice-contact-block {
    text-align: right;
    font-size: 0.8rem;
    color: #000000;
    line-height: 1.4;
    max-width: 320px;
}

.contact-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.contact-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: #4b5563;
    margin-bottom: 4px;
}

.contact-divider {
    height: 1.5px;
    background-color: #0a2569;
    width: 60px;
    margin-left: auto;
    margin-bottom: 6px;
}

.contact-item {
    font-weight: 400;
}

.contact-address {
    font-weight: 400;
    margin-top: 3px;
}

/* Deep Navy Banner bar for "INVOICE" */
.invoice-banner {
    background-color: #06183a;
    color: #ffffff;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 28px;
}

/* Metadata lists */
.invoice-billed-to {
    margin-bottom: 24px;
}

.billed-to-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.billed-row {
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.billed-row .label {
    font-weight: 400;
    color: #000000;
    margin-right: 4px;
}

.billed-row .value {
    font-weight: 700;
    color: #000000;
}

/* Dates meta block */
.invoice-dates-details {
    margin-bottom: 30px;
}

.date-row {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.date-row .label {
    font-weight: 700;
    color: #000000;
    margin-right: 6px;
}

.date-row .value {
    font-weight: 700;
    color: #000000;
}

/* Table Grid Styles */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
}

.invoice-table th, .invoice-table td {
    padding: 8px 12px;
    font-size: 0.8rem;
}

.invoice-table th {
    font-weight: 700;
    text-transform: uppercase;
    border-top: 1.5px solid #000000;
    border-bottom: 1.5px solid #000000;
    color: #000000;
}

.col-contractor {
    text-align: left;
    width: 45%;
}

.col-rate {
    text-align: center;
    width: 20%;
}

.col-hours {
    text-align: center;
    width: 15%;
}

.col-amount {
    text-align: right;
    width: 20%;
}

.invoice-table tbody tr {
    border-bottom: 1.2px solid #000000;
}

.invoice-table tbody td {
    color: #000000;
    font-weight: 400;
}

.invoice-table th:not(:last-child),
.invoice-table td:not(:last-child) {
    border-right: 1.2px solid #000000;
}

.invoice-table tbody td.col-contractor {
    text-align: left;
    text-transform: uppercase;
}

.invoice-table tbody td.col-rate,
.invoice-table tbody td.col-hours {
    text-align: center;
}

.invoice-table tbody td.col-amount {
    text-align: right;
}

/* Grand total footers */
.invoice-table tfoot .total-row {
    border-bottom: none;
}

.invoice-table tfoot td {
    padding: 10px 12px;
    font-weight: 700;
    border-right: none !important;
}

.invoice-table tfoot .total-label {
    text-align: left;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.invoice-table tfoot .total-amount {
    text-align: right;
    font-size: 0.95rem;
}

/* Payment & wire details block */
.invoice-payment-info {
    margin-top: 24px;
    margin-bottom: 35px;
}

.payment-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.payment-row {
    margin-bottom: 3px;
    font-size: 0.85rem;
}

.payment-row .label {
    font-weight: 400;
    color: #000000;
    margin-right: 4px;
}

.payment-row .value {
    font-weight: 400;
    color: #000000;
}

/* Footer layout details */
.invoice-footer {
    text-align: center;
    font-size: 0.78rem;
    color: #4b5563;
    margin-top: auto;
    padding-top: 24px;
}

/* PDF Print Export Margins & Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .invoice-pdf-document, .invoice-pdf-document * {
        visibility: visible;
    }
    
    .invoice-pdf-document {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        padding: 0.5in;
        margin: 0;
    }
}

/* Card Accordion Toggle */
.preview-controls .card-title,
.invoice-sidebar .card-title {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 32px;
}
.preview-controls .card-title::after,
.invoice-sidebar .card-title::after {
    content: '▲';
    font-size: 0.7rem;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: #64748b;
}
.preview-controls .card.collapsed .card-title::after,
.invoice-sidebar .card.collapsed .card-title::after {
    content: '▼';
}
.preview-controls .card.collapsed > :not(.card-title):not(style):not(script),
.invoice-sidebar .card.collapsed > :not(.card-title):not(style):not(script) {
    display: none !important;
}

