:root {
            --brand-orange: #ff7b1f;
            --brand-navy: #0f172a;
            --accent-glow: rgba(255, 123, 31, 0.3);
            --bg-soft: #f8fafc;
            --app-bg: #f3f4f6;
            --sidebar-bg: #ffffff;
            --border-color: #e5e7eb;
            --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
        body { font-family: 'Inter', sans-serif; color: #1f2937; overflow: hidden; background: var(--bg-soft); }

        /* --- LOGIN SCREEN --- */
        #view-login {
            height: 100vh; width: 100vw; position: fixed; top: 0; left: 0;
            background: var(--brand-navy); display: flex; justify-content: center; align-items: center; z-index: 1000;
        }
        .login-card {
            background: white; padding: 40px; border-radius: 15px; width: 400px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3); text-align: center;
        }
        .login-card h1 { font-family: 'Montserrat'; font-weight: 900; color: var(--brand-navy); margin-bottom: 5px; }
        .login-card p { color: #666; font-size: 0.9rem; margin-bottom: 25px; }
        .login-field { text-align: left; margin-bottom: 15px; }
        .login-field label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--brand-navy); }
        .login-field input { width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 8px; margin-top: 5px; outline: none; transition: 0.3s; }
        .login-field input:focus { border-color: var(--brand-orange); }
        .btn-login { width: 100%; padding: 15px; background: var(--brand-orange); color: white; border: none; border-radius: 8px; font-weight: 800; cursor: pointer; margin-top: 10px; }
        #login-error { color: #ef4444; font-size: 0.8rem; margin-top: 10px; display: none; }

        /* --- NAVIGATION SYSTEM --- */
        .view-hidden { display: none !important; }

        /* Prevent login flash on refresh when already authenticated */
        html.mm-authed #view-login,
        html.mm-client #view-login {
            display: none !important;
        }
        html.mm-view-portal #view-portal.view-hidden,
        html.mm-view-invoice #view-invoice.view-hidden,
        html.mm-view-contract #view-contract.view-hidden {
            display: flex !important;
        }
        
        .btn-back {
            display: inline-flex; align-items: center; gap: 8px;
            background: none; border: none; color: var(--brand-navy);
            font-weight: 700; font-size: 0.85rem; cursor: pointer;
            margin-bottom: 15px; padding: 5px 0; transition: color 0.3s;
        }
        .btn-back:hover { color: var(--brand-orange); }

        /* =========================================
           1. PORTAL STYLES 
           ========================================= */
        #view-portal {
            height: 100vh;
            display: flex; justify-content: center; align-items: center;
            background-color: var(--bg-soft);
            background-image: 
                radial-gradient(at 0% 0%, rgba(255, 123, 31, 0.05) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.05) 0px, transparent 50%);
        }
        

        .main-wrapper { position: relative; width: 100%; max-width: 1200px; display: flex; flex-direction: column; align-items: center; }
        .portal-grid { display: flex; flex-direction: column; filter: drop-shadow(0 20px 50px rgba(0,0,0,0.08)); }
        
        .portal-card {
            position: relative; width: 680px; height: 220px; text-decoration: none;
            display: flex; align-items: center; transition: var(--transition); z-index: 1; overflow: hidden; cursor: pointer;
        }

        .invoice-tab {
            background: linear-gradient(90deg, rgba(255,255,255,0) 0%, var(--brand-orange) 85%);
            clip-path: polygon(0 0, 88% 0, 100% 25%, 100% 100%, 0 100%);
            border-radius: 60px 0 0 60px; justify-content: flex-end; padding-right: 100px; margin-bottom: -55px; 
        }

        .contract-tab {
            background: linear-gradient(90deg, var(--brand-orange) 15%, rgba(255,255,255,0) 100%);
            clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%, 0 75%);
            border-radius: 0 60px 60px 0; justify-content: flex-start; padding-left: 140px;
        }

        .content-box { color: white; display: flex; flex-direction: column; pointer-events: none; }
        .invoice-tab .content-box { align-items: flex-end; text-align: right; }
        .title { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 46px; text-transform: uppercase; letter-spacing: 1px; line-height: 1; margin-bottom: 8px; }
        .subtitle { font-size: 14px; font-weight: 500; letter-spacing: 3px; text-transform: uppercase; opacity: 0.9; display: flex; align-items: center; gap: 10px; }

        .portal-card::after {
            content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
            transform: translateX(-100%); transition: 0.6s;
        }
        .portal-card:hover::after { transform: translateX(100%); }
        .portal-card:hover { transform: scale(1.02); z-index: 10; filter: brightness(1.1) contrast(1.1); }
        .invoice-tab:hover { transform: translateX(15px) scale(1.02); }
        .contract-tab:hover { transform: translateX(-15px) scale(1.02); }
        .portal-card i { transition: var(--transition); }
        .portal-card:hover i { transform: scale(1.2) rotate(-5deg); color: var(--brand-navy); }

        @media (max-width: 800px) {
            .portal-card { width: 90vw; height: 160px; padding: 0 40px !important; }
            .title { font-size: 28px; }
            .subtitle { font-size: 11px; }
            .invoice-tab { margin-bottom: -30px; }
        }

        /* =========================================
           2. SHARED APP LAYOUT (Invoice & Contract)
           ========================================= */
        .app-layout { height: 100vh; display: flex; background: var(--app-bg); }
        
        .sidebar {
            width: 400px; min-width: 400px; background: var(--sidebar-bg);
            height: 100%; overflow-y: auto; border-right: 1px solid var(--border-color);
            padding: 20px 25px; z-index: 10;
        }
        .sidebar-header { margin-bottom: 20px; border-bottom: 3px solid var(--brand-orange); padding-bottom: 10px; }
        .sidebar-header h2 { margin: 0; color: var(--brand-navy); font-weight: 900; font-size: 1.5rem; }
        .sidebar-header-with-action {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .sidebar-header-with-action h2 { flex: 1; min-width: 0; }
        .btn-save-client {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border: none;
            border-radius: 6px;
            background: var(--brand-navy);
            color: #fff;
            padding: 8px 12px;
            font-size: 0.75rem;
            font-weight: 800;
            font-family: inherit;
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-save-client:hover { background: var(--brand-orange); }
        .btn-save-client:disabled { opacity: 0.65; cursor: wait; }
        .btn-save-client.is-saved { background: #059669; }
        .control-group { margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; }
        .control-group h3 { font-size: 0.75rem; color: #9ca3af; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 1px; }
        
        .field { margin-bottom: 12px; }
        .field label { display: block; font-size: 0.7rem; font-weight: 700; margin-bottom: 4px; color: #374151; text-transform: uppercase; }
        .field input, .field textarea { width: 100%; padding: 9px; border: 1.5px solid var(--border-color); border-radius: 6px; font-size: 0.85rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
        .field input:focus, .field textarea:focus { border-color: var(--brand-orange); outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
        .field input[readonly] { background-color: #f3f4f6; color: #6b7280; cursor: not-allowed; }
        
        .btn-download { width: 100%; background: var(--brand-navy); color: white; border: none; padding: 14px; border-radius: 8px; font-weight: 800; cursor: pointer; margin-top: 10px; transition: 0.3s; }
        .btn-download:hover { background: var(--brand-orange); }

        .preview-pane { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 40px; }

        .share-link-box {
            background: #f0fdf4; border: 1px solid #bbf7d0; padding: 10px; border-radius: 6px; margin-top: 10px; display: none;
        }
        .share-link-box input { width: 100%; font-size: 0.7rem; padding: 5px; margin-bottom: 5px; border: 1px solid #ddd; }
        .btn-copy { background: #10b981; color: white; border: none; padding: 5px 10px; border-radius: 4px; font-size: 0.7rem; cursor: pointer; font-weight: bold; }

        /* =========================================
           3. INVOICE SPECIFIC STYLES 
           ========================================= */
        .invoice-sidebar .sidebar-subtitle { font-size: 0.8rem; color: #6b7280; margin-top: 6px; line-height: 1.4; }
        .field-row { display: flex; gap: 10px; }
        .field-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
        .field-hint { display: block; font-size: 0.68rem; color: #9ca3af; margin-top: 5px; line-height: 1.4; }
        .input-with-btn { display: flex; gap: 6px; }
        .input-with-btn input { flex: 1; min-width: 0; }
        .btn-generate {
            flex-shrink: 0;
            width: 38px;
            border: 1.5px solid var(--border-color);
            border-radius: 6px;
            background: #fff;
            color: var(--brand-navy);
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-generate:hover { border-color: var(--brand-orange); color: var(--brand-orange); background: #fff7ed; }
        .control-optional { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9ca3af; }

        .item-row {
            display: block;
            margin-bottom: 12px;
            background: #f9fafb;
            padding: 10px;
            border-radius: 6px;
            border: 1px solid #eef2f7;
        }
        .item-desc {
            width: 100%;
            min-height: 96px;
            padding: 10px 12px;
            font-size: 0.85rem;
            line-height: 1.5;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: #fff;
            resize: vertical;
            font-family: inherit;
        }
        .item-desc:focus { border-color: var(--brand-orange); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
        .item-row-fields {
            display: grid;
            grid-template-columns: 1fr 1fr 36px;
            gap: 10px;
            align-items: end;
            margin-top: 10px;
        }
        .item-field label,
        .item-field-desc > span {
            display: block;
            font-size: 0.65rem;
            font-weight: 700;
            color: #9ca3af;
            text-transform: uppercase;
            margin-bottom: 4px;
            letter-spacing: 0.04em;
        }
        .item-field-desc { display: block; }
        .item-row input {
            width: 100%;
            padding: 7px 8px;
            font-size: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: #fff;
        }
        .item-row input:focus { border-color: var(--brand-orange); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
        .btn-remove-item {
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 6px;
            background: #fee2e2;
            color: #dc2626;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
        }
        .btn-remove-item:hover:not(:disabled) { background: #fecaca; }
        .btn-remove-item:disabled { opacity: 0.35; cursor: not-allowed; }

        .btn-add {
            width: 100%;
            padding: 10px;
            background: #fff;
            border: 2px dashed #cbd5e1;
            cursor: pointer;
            font-weight: 700;
            color: #475569;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: 0.2s;
        }
        .btn-add:hover { border-color: var(--brand-orange); color: var(--brand-navy); background: #fff7ed; }

        .inv-summary {
            background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 14px;
            margin-bottom: 12px;
        }
        .inv-summary-row {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            padding: 4px 0;
            font-size: 0.82rem;
            color: #4b5563;
        }
        .inv-summary-total {
            margin-top: 8px;
            padding-top: 10px;
            border-top: 2px solid var(--brand-orange);
            font-size: 0.95rem;
            font-weight: 800;
            color: var(--brand-navy);
        }

        .sidebar-actions {
            position: sticky;
            bottom: 0;
            background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #ffffff 18%);
            padding: 12px 0 4px;
            margin-top: auto;
        }
        .sidebar-actions .btn-download {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        .a4-page {
            width: 210mm; height: 297mm; background: white; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden; flex-shrink: 0; background-image: url('Image/Cover-Image.jpg');
            background-size: 100% 100%; background-repeat: no-repeat; box-sizing: border-box;
        }

        .invoice-body { position: absolute; top: 28mm; left: 20mm; right: 20mm; bottom: 50mm; display: flex; flex-direction: column; }
        .inv-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; }
        .inv-header h1 { font-size: 38pt; font-weight: 900; color: var(--brand-navy); margin: 0; }
        .meta-text { text-align: right; }
        .meta-label { font-size: 8pt; color: #999; font-weight: 700; text-transform: uppercase; }
        .meta-val { font-size: 11pt; font-weight: 700; display: block; margin-bottom: 5px; }

        .billing-info { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 30px; }
        .billing-info h4 { font-size: 8pt; color: var(--brand-orange); text-transform: uppercase; margin: 0 0 5px 0; }
        .billing-info p { font-size: 10pt; line-height: 1.4; margin: 0; color: #333; white-space: pre-line; }

        .data-table { width: 100%; border-collapse: collapse; }
        .data-table th { border-bottom: 2px solid var(--brand-navy); text-align: left; padding: 10px; font-size: 8pt; color: #666; text-transform: uppercase; }
        .data-table td { padding: 12px 10px; border-bottom: 1px solid #eee; font-size: 10pt; color: #333; }

        .footer-content { margin-top: auto; }
        .totals-wrap { width: 250px; margin-left: auto; margin-bottom: 15px; }
        .total-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10pt; }
        .total-line.grand { border-top: 2px solid var(--brand-orange); margin-top: 5px; padding-top: 8px; font-weight: 900; font-size: 12pt; color: var(--brand-navy); }

        .bank-details { background: #f8f9fa; border: 1px solid #eee; border-radius: 8px; padding: 15px; display: grid; grid-template-columns: 1.2fr 1fr; font-size: 8.5pt; line-height: 1.6; }
        .bank-details strong { color: var(--brand-navy); display: block; margin-bottom: 4px; text-transform: uppercase; }

        /* =========================================
           4. CONTRACT SPECIFIC STYLES 
           ========================================= */
        .contract-page {
            width: 210mm; height: 297mm; background-color: white; background-image: url('Image/Cover-Image.jpg'); 
            background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
            margin-bottom: 5px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); position: relative; 
            padding: 30mm 16mm 40mm 16mm; display: flex; flex-direction: column; flex-shrink: 0;
            box-sizing: border-box;
        }

        .doc-title-row {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            margin-bottom: 4px;
        }
        .doc-title { text-align: center; font-size: 32pt; font-weight: 800; color: var(--brand-navy); letter-spacing: 2px; margin: 0; }
        .doc-contract-no {
            margin-left: auto;
            font-size: 12pt;
            font-weight: 700;
            color: #fff;
            letter-spacing: 1px;
            white-space: nowrap;
        }
        .section-bar { background: var(--brand-navy); color: white; padding: 4px 12px; font-weight: 700; font-size: 15pt; margin: 15px 0 10px 0; display: flex; align-items: center; gap: 10px; }
        
        .details-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
        .details-col { display: flex; flex-direction: column; gap: 6px; }
        .row-item { display: flex; align-items: center; justify-content: space-between; }
        .row-item label { font-size: 9pt; font-weight: 700; color: #333; width: 120px; flex-shrink: 0; text-transform: none;}
        .box-val { border: 1px solid var(--border-color); padding: 4px 8px; font-size: 9pt; flex-grow: 1; min-height: 24px; color: #444; }

        .large-border-box { border: 1px solid var(--brand-navy); padding: 15px; min-height: 180px; font-size: 8pt; line-height: 1.5; color: #333; font-weight: 700; }
        .orange-h3 { color: var(--brand-orange); font-size: 14pt; font-weight: 700; margin: 10px 0; }
        
        .fees-wrap { width: 320px; margin-bottom: 10px; }
        .fee-row { display: flex; align-items: center; margin-bottom: 6px; }
        .fee-row label { width: 120px; font-size: 9pt; font-weight: 700; color: #333; text-transform: none;}
        .fee-box { border: 1px solid var(--border-color); padding: 4px 10px; font-weight: 800; font-size: 9pt; width: 200px; }

        .payment-box { border: 1px solid var(--brand-navy); padding: 15px; min-height: 120px; font-size: 8pt; line-height: 1.6; font-weight: 700; color: #333; }

        .auth-section { display: flex; gap: 50px; margin-top: 20px; }
        .auth-col { flex: 1; }
        .sig-dashed { border: 1px dashed #ccc; height: 80px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; cursor: pointer; }
        .sig-dashed:hover { background: #f0f4f8; }
        .auth-text { font-size: 9pt; font-weight: 700; margin-bottom: 4px;}
        
        .sig-style { font-family: 'Dancing Script', cursive; font-size: 24pt; color: var(--brand-navy); pointer-events: none; user-select: none; }

.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.sig-style-option {
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    transition: 0.2s;
    background: #fff;
}

.sig-style-option:hover { border-color: var(--brand-orange); background: #fffcf9; }

.sig-style-option.selected {
    border-color: var(--brand-orange);
    background: #fff7ed;
    box-shadow: 0 0 0 2px var(--brand-orange);
}

.sig-type-name {
    font-family: 'Inter', sans-serif;
}

.font-style-1 { font-family: 'Dancing Script', cursive; }
.font-style-2 { font-family: 'Pacifico', cursive; }
.font-style-3 { font-family: 'Great Vibes', cursive; }
.font-style-4 { font-family: 'Alex Brush', cursive; }
.font-style-5 { font-family: 'Satisfy', cursive; }
.font-style-6 { font-family: 'Tangerine', cursive; font-weight: 700; }
.font-style-7 { font-family: 'Lobster', cursive; }
.font-style-8 { font-family: 'Kaushan Script', cursive; }
.font-style-9 { font-family: 'Yellowtail', cursive; }
.font-style-10 { font-family: 'Playball', cursive; }
.font-style-11 { font-family: 'Parisienne', cursive; }
.font-style-12 { font-family: 'Allura', cursive; }

        /* =========================================
           5. CLIENT MODE & SIGNATURE SPECIFIC
           ========================================= */
        .client-bar {
            display: none; width: 100%; background: var(--brand-navy); color: white;
            padding: 15px 30px; justify-content: space-between; align-items: center;
            position: fixed; top: 0; left: 0; z-index: 100;
        }
        .client-bar h2 { font-size: 1.2rem; }
        .client-bar .btn-download { width: auto; margin-top: 0; padding: 10px 20px; background: var(--brand-orange); }

        body.client-mode .sidebar, body.client-mode #view-portal, body.client-mode .btn-back { display: none !important; }
        body.client-mode .client-bar { display: flex; }
        body.client-mode .app-layout { height: calc(100vh - 60px); margin-top: 60px; }
        body.client-mode .preview-pane { padding: 20px; }

        /* Signature Modal */
        .modal {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 200;
        }
        .modal-content { background: white; padding: 25px; border-radius: 12px; width: 450px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
        .modal-content h3 { margin-bottom: 15px; color: var(--brand-navy); }
        .canvas-wrap { border: 2px dashed #ccc; border-radius: 6px; margin-bottom: 15px; }
        canvas { width: 100%; height: 200px; cursor: crosshair; touch-action: none; display: block; background: #fff; }
        .signature-mode-tabs { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 15px; }
        .signature-mode-btn { border: 1px solid var(--border-color); background: #fff; color: var(--brand-navy); padding: 10px; border-radius: 6px; font-weight: 800; cursor: pointer; }
        .signature-mode-btn.active { border-color: var(--brand-orange); background: #fff7ed; color: var(--brand-orange); }
        .modal-actions { display: flex; justify-content: space-between; gap: 10px; }
        .btn-modal { padding: 10px 15px; border: none; border-radius: 6px; cursor: pointer; font-weight: 700; flex: 1; }
        .btn-save { background: var(--brand-orange); color: white; }
        .btn-clear { background: #e5e7eb; color: #374151; }
        .btn-cancel { background: #ef4444; color: white; }

        #vc-sig-img img { max-height: 70px; max-width: 100%; object-fit: contain; }

        @media print {
            .no-print, #view-portal, .sidebar, .client-bar, .modal, #view-login { display: none !important; }
            body { background: white; padding: 0; overflow: visible !important; }
            .app-layout { margin-top: 0 !important; height: auto !important; }
            .preview-pane { padding: 0 !important; overflow: visible !important; }
            .a4-page, .contract-page { box-shadow: none; margin: 0; page-break-after: always; }
        }



        /* Payment Schedule Table Styling */
.payment-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
}

.payment-schedule-table th {
    background-color: #f3f4f6;
    color: #1f2937;
    font-weight: 700;
    font-size: 10pt;
    padding: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.payment-schedule-table td {
    padding: 10px;
    border: 1px solid #e5e7eb;
    text-align: center;
    font-size: 10pt;
    color: #374151;
}

.payment-date-pill {
    background: #e5e7eb;
    padding: 2px 12px;
    border-radius: 12px;
    display: inline-block;
}

.sidebar-payment-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 30px;
    gap: 5px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eee;
}

.sidebar-payment-row input {
    padding: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.payment-date-field {
    position: relative;
    display: flex;
    align-items: center;
}

.payment-date-field .payment-date-text {
    width: 100%;
    padding-right: 2rem;
}

.payment-date-cal-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    font-size: 0.9rem;
    z-index: 1;
}

.payment-date-cal-btn:hover {
    color: var(--brand-orange);
}

.payment-date-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
}
/* Sidebar Row Styling */
.sidebar-payment-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 30px;
    gap: 8px;
    margin-bottom: 10px;
    background: #f9fafb;
    padding: 8px;
    border-radius: 6px;
    align-items: center;
}

/* Contract Preview Table Styling */
.payment-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
}

.payment-schedule-table th {
    background-color: #eeeeee;
    color: #000;
    font-weight: 800;
    font-size: 10pt;
    padding: 12px 8px;
    border: 2px solid #0f172a;
    text-align: center;
}

.payment-schedule-table td {
    padding: 10px 8px;
    border: 2px solid #0f172a;
    text-align: center;
    font-size: 10pt;
    color: #333;
}

/* The Date Pill Style from your image */
.payment-date-pill {
    background: #e5e7eb;
    padding: 2px 15px;
    border-radius: 15px;
    display: inline-block;
    font-weight: 500;
}

.grand-total-row td { border: none; }
.grand-total-row .label-cell { 
    font-weight: 800; 
    font-size: 12pt; 
    text-align: right; 
    padding-right: 15px;
}
.grand-total-row .value-cell { 
    font-weight: 800; 
    font-size: 12pt; 
    border: 2px solid #0f172a !important;
}