/**
 * IAS Event Manager - Frontend Page Styles
 * Contract signing, payment, and signature pages
 */

/* ==========================================================================
   Contract Signing Page
   ========================================================================== */

.ias-contract-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.ias-contract-page h2 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.ias-contract-page p {
    color: #555;
    line-height: 1.6;
}

/* PDF Embed */
.ias-contract-pdf-embed {
    margin: 20px 0 30px;
}

.ias-contract-pdf-embed iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ias-contract-pdf-embed .button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.ias-contract-pdf-embed .button:hover {
    background: #1b5e20;
    color: #fff;
}

/* PDF action buttons row */
.ias-contract-pdf-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
}

.ias-contract-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ias-contract-fullscreen-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.ias-contract-fullscreen-btn svg {
    flex-shrink: 0;
}

/* PDF Fullscreen Lightbox */
.ias-pdf-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
}

.ias-pdf-lightbox.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ias-pdf-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.ias-pdf-lightbox-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.ias-pdf-lightbox-content iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.ias-pdf-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.15s;
    z-index: 1;
}

.ias-pdf-lightbox-close:hover {
    opacity: 1;
}

/* ==========================================================================
   Contract — Action Required Banner
   ========================================================================== */

.ias-contract-action-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #f9a825;
    border-radius: 8px;
    margin-bottom: 24px;
}

.ias-contract-action-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #fff3cd;
    border-radius: 50%;
    color: #e65100;
}

.ias-contract-action-text strong {
    display: block;
    font-size: 16px;
    color: #e65100;
    margin-bottom: 4px;
}

.ias-contract-action-text p {
    margin: 0;
    font-size: 14px;
    color: #5d4037;
    line-height: 1.5;
}

/* ==========================================================================
   Payments Tab — Action Required Banner
   ========================================================================== */

.ias-payment-action-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-left: 4px solid #2e7d32;
    border-radius: 8px;
    margin-bottom: 24px;
}

.ias-payment-action-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #c8e6c9;
    border-radius: 50%;
    color: #2e7d32;
}

.ias-payment-action-text strong {
    display: block;
    font-size: 16px;
    color: #1b5e20;
    margin-bottom: 4px;
}

.ias-payment-action-text p {
    margin: 0;
    font-size: 14px;
    color: #33691e;
    line-height: 1.5;
}

/* "Noted" variant — after check/cash declared */
.ias-payment-action-banner--noted {
    background: #f5f5f5;
    border-color: #e0e0e0;
    border-left-color: #9e9e9e;
}

.ias-payment-action-banner--noted .ias-payment-action-icon {
    background: #e0e0e0;
    color: #616161;
}

.ias-payment-action-banner--noted .ias-payment-action-text strong {
    color: #424242;
}

.ias-payment-action-banner--noted .ias-payment-action-text p {
    color: #616161;
}

/* ==========================================================================
   Signature Section
   ========================================================================== */

.ias-signature-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid #e0e0e0;
}

.ias-signature-section h3 {
    margin: 0 0 20px;
    color: #333;
}

/* Signature Type Selector */
.ias-signature-type-selector {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.ias-sig-type-btn {
    padding: 10px 24px;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.ias-sig-type-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.ias-sig-type-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.ias-sig-type-btn.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* Signature Pad */
.ias-signature-pad-container {
    margin-bottom: 20px;
}

#ias-signature-canvas {
    width: 100%;
    max-width: 600px;
    height: 200px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: crosshair;
    display: block;
    touch-action: none;
}

#ias-clear-signature {
    margin-top: 10px;
    padding: 6px 16px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

#ias-clear-signature:hover {
    background: #e0e0e0;
}

/* Typed Signature */
#ias-type-signature input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

#ias-type-signature select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ias-typed-signature-preview {
    min-height: 80px;
    padding: 20px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 32px;
    color: #333;
    display: flex;
    align-items: center;
    max-width: 600px;
}

/* Agreement Text */
.ias-signature-agreement {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-left: 4px solid #2e7d32;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* Submit Button */
.ias-submit-signature {
    display: inline-block;
    padding: 12px 30px !important;
    background: #2e7d32 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ias-submit-signature:hover {
    background: #1b5e20 !important;
}

/* ==========================================================================
   Contract Signing Block (Action Items Tab)
   ========================================================================== */

.ias-contract-signing-block {
    margin-bottom: 30px;
}

.ias-contract-step {
    margin-bottom: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.ias-contract-step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.ias-contract-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2e7d32;
    color: #fff;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.ias-contract-step-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ias-contract-pdf-embed--compact iframe {
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ias-contract-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #555;
    font-size: 14px;
    text-decoration: none;
}

.ias-contract-download-link:hover {
    color: #333;
    text-decoration: underline;
}

.ias-contract-signing-block .ias-signature-section {
    background: transparent;
    padding: 0;
    border: none;
    margin: 0;
}

/* Contract Unsigned Placeholder (Contract Tab) */
.ias-contract-unsigned-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.ias-contract-unsigned-placeholder svg {
    stroke: #ccc;
    margin-bottom: 16px;
}

.ias-contract-unsigned-placeholder h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #666;
}

.ias-contract-unsigned-placeholder p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #888;
}

.ias-contract-unsigned-placeholder .ias-status-card-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.ias-contract-unsigned-placeholder .ias-status-card-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

/* ==========================================================================
   Guest Guarantee History Table
   ========================================================================== */

.ias-gg-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ias-gg-history-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e0e0e0;
}

.ias-gg-history-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.ias-gg-history-table tbody tr:last-child td {
    border-bottom: none;
}

.ias-gg-adj-up {
    color: #b91c1c;
    font-weight: 600;
}

.ias-gg-adj-down {
    color: #15803d;
    font-weight: 600;
}

/* ==========================================================================
   Payment Pages
   ========================================================================== */

.ias-payment-page,
.ias-payment-success,
.ias-payment-cancelled {
    max-width: 600px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.ias-payment-success {
    color: #333;
}

.ias-payment-success .ias-success-icon {
    font-size: 64px;
    color: #2e7d32;
    margin-bottom: 20px;
}

.ias-payment-success h2 {
    color: #2e7d32;
}

.ias-payment-cancelled h2 {
    color: #d9534f;
}

/* Payment Method Selection */
.ias-payment-methods {
    max-width: 600px;
    margin: 30px auto;
}

.ias-payment-method-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    transition: border-color 0.2s;
}

.ias-payment-method-card:hover {
    border-color: #2e7d32;
}

.ias-payment-method-card h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.ias-payment-method-card p {
    color: #666;
    margin: 0 0 15px;
    font-size: 14px;
}

.ias-pay-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

.ias-pay-btn:hover {
    background: #1b5e20;
    color: #fff;
}

/* Pricing Breakdown Display */
.ias-pricing-breakdown {
    text-align: left;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.ias-pricing-breakdown table {
    width: 100%;
    border-collapse: collapse;
}

.ias-pricing-breakdown th,
.ias-pricing-breakdown td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.ias-pricing-breakdown th {
    font-weight: 600;
    color: #333;
}

.ias-pricing-breakdown .total-row td {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid #333;
    padding-top: 12px;
}

/* ==========================================================================
   Error Pages
   ========================================================================== */

.ias-error-page {
    max-width: 500px;
    margin: 80px auto;
    padding: 40px 20px;
    text-align: center;
}

.ias-error-page h2 {
    color: #d9534f;
}

.ias-error-page p {
    color: #666;
    line-height: 1.6;
}

/* Already Signed Page */
.ias-already-signed {
    max-width: 500px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.ias-already-signed h2 {
    color: #2e7d32;
}

/* ==========================================================================
   Client Portal (v1.5.0)
   ========================================================================== */

/* Portal Page Container */
.ias-portal-page {
    max-width: 800px;
    margin: 15vh auto 0;
    padding: 20px 20px 40px;
}

/* Portal Header */
.ias-portal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ias-portal-title {
    margin: 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
    line-height: 1.3;
}

/* Status Badge */
.ias-portal-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ias-status-contract_sent {
    background: #fff3cd;
    color: #856404;
}

.ias-status-contract_signed {
    background: #cce5ff;
    color: #004085;
}

.ias-status-deposit_received {
    background: #d4edda;
    color: #155724;
}

.ias-status-confirmed {
    background: #d4edda;
    color: #155724;
}

.ias-status-completed {
    background: #e2e3e5;
    color: #383d41;
}

.ias-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Progress Bar */
.ias-portal-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 20px 0 30px;
    padding: 0;
    position: relative;
}

.ias-portal-progress::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.ias-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.ias-progress-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #e0e0e0;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.ias-progress-step.is-done .ias-progress-dot {
    background: #2e7d32;
    border-color: #2e7d32;
}

.ias-progress-step.is-active .ias-progress-dot {
    background: #fff;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.ias-progress-label {
    font-size: 12px;
    color: #999;
    text-align: center;
    font-weight: 500;
}

.ias-progress-step.is-done .ias-progress-label,
.ias-progress-step.is-active .ias-progress-label {
    color: #2e7d32;
    font-weight: 600;
}

/* Portal Content Sections */
.ias-portal-content {
    min-height: 200px;
}

.ias-portal-section {
    margin-bottom: 30px;
}

.ias-portal-section h2 {
    color: #2e7d32;
    margin: 0 0 10px;
    font-size: 22px;
}

.ias-portal-section h3 {
    color: #333;
    margin: 0 0 15px;
    font-size: 18px;
}

/* Success & Warning Notices */
.ias-success-notice {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 20px 25px;
    border-radius: 4px;
}

.ias-success-notice h2 {
    color: #2e7d32;
    margin: 0 0 8px;
}

.ias-success-notice p {
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.ias-warning-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px 25px;
    border-radius: 4px;
}

.ias-warning-notice h2 {
    color: #856404;
    margin: 0 0 8px;
}

.ias-warning-notice p {
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* Flash Messages */
.ias-flash {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

.ias-flash strong {
    display: block;
    margin-bottom: 4px;
}

.ias-flash-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ias-flash-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* Event Summary Table */
.ias-event-summary {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.ias-event-summary table {
    width: 100%;
    border-collapse: collapse;
}

.ias-event-summary th,
.ias-event-summary td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.ias-event-summary th {
    font-weight: 600;
    color: #555;
    width: 160px;
}

.ias-event-summary td {
    color: #333;
}

.ias-event-summary tr:last-child th,
.ias-event-summary tr:last-child td {
    border-bottom: none;
}

/* Payment Method Label */
.ias-payment-method-label {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

/* Mailing Address */
.ias-mailing-address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 10px;
}

/* Payment Note */
.ias-payment-note {
    font-size: 13px !important;
    color: #888 !important;
    font-style: italic;
}

/* Portal Footer */
.ias-portal-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.ias-portal-footer p {
    margin: 0 0 4px;
    color: #999;
    font-size: 13px;
    line-height: 1.5;
}

.ias-portal-footer p:first-child {
    font-weight: 600;
    color: #666;
}

/* Generic button used in portal */
.ias-portal-page .button {
    display: inline-block;
    padding: 10px 24px;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.ias-portal-page .button:hover {
    background: #1b5e20;
    color: #fff;
}

/* ==========================================================================
   Client Portal — Payment Schedule (v1.6.0)
   ========================================================================== */

/* Schedule Table */
.ias-portal-schedule {
    margin-top: 10px;
}

.ias-portal-schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.ias-portal-schedule-table thead th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e0e0e0;
}

.ias-portal-schedule-table tbody td {
    padding: 14px;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ias-portal-schedule-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row states */
.ias-portal-row-paid {
    background: #f0f9f0;
}

.ias-portal-row-overdue {
    background: #fef2f2;
}

.ias-portal-row-soon {
    background: #fffbeb;
}

/* Status badges */
.ias-portal-status-paid {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #d4edda;
    color: #155724;
}

.ias-completed-date {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.ias-portal-status-overdue {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #f8d7da;
    color: #721c24;
}

.ias-portal-status-soon {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fff3cd;
    color: #856404;
}

.ias-portal-status-pending {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e3e5;
    color: #383d41;
}

/* Pay Online button (in schedule table) */
.ias-portal-pay-btn {
    display: inline-block;
    padding: 6px 16px;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s;
}

.ias-portal-pay-btn:hover {
    background: #1b5e20;
    color: #fff;
}

/* Check/Cash declaration button */
.ias-portal-check-btn {
    display: inline-block;
    padding: 6px 12px;
    background: transparent;
    color: #555;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.2s;
}

.ias-portal-check-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Standalone payment action buttons (outside schedule table) */
.ias-portal-pay-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.ias-portal-pay-actions .ias-portal-pay-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
}

.ias-portal-pay-actions .ias-portal-check-btn {
    padding: 10px 20px;
    font-size: 13px;
    margin-left: 0;
}

/* Smaller "switch" link after check/cash declared */
.ias-portal-pay-btn-sm {
    display: inline-block;
    padding: 3px 10px;
    background: transparent;
    color: #2e7d32;
    text-decoration: none;
    border: 1px solid #2e7d32;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    margin-top: 4px;
}

.ias-portal-pay-btn-sm:hover {
    background: #2e7d32;
    color: #fff;
}

/* Client declared intent badge */
.ias-portal-intent-declared {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ias-portal-intent-check {
    background: #fff3cd;
    color: #856404;
}

.ias-portal-intent-check .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ias-portal-schedule-action {
    text-align: right;
    min-width: 180px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

/* Schedule Summary Bar */
.ias-portal-schedule-summary {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-top: 14px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.ias-portal-schedule-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ias-portal-stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.ias-portal-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.ias-portal-stat-paid {
    color: #2e7d32;
}

/* Guest Guarantee — Inline Form (inside payment schedule table) */
.ias-guarantee-inline-form {
    margin: 0;
}

.ias-guarantee-inline-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ias-guarantee-inline-input {
    width: 80px !important;
    max-width: 80px !important;
    min-width: 0 !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: auto !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    text-align: center;
    box-sizing: border-box !important;
    -moz-appearance: textfield;
}

.ias-guarantee-inline-input::-webkit-inner-spin-button,
.ias-guarantee-inline-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ias-guarantee-guest-count {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Hide the border between the GG row and its help row so they look like one block */
tr:has(+ .ias-guarantee-help-row) td {
    border-bottom: none !important;
}

.ias-guarantee-help-row td {
    padding-top: 0 !important;
    padding-bottom: 14px !important;
    border-top: none !important;
}

/* Inherit the row background from the GG row above */
.ias-portal-row-overdue + .ias-guarantee-help-row { background: #fef2f2; }
.ias-portal-row-soon + .ias-guarantee-help-row { background: #fffbeb; }

.ias-guarantee-help-text {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ==========================================================================
   Client Portal — Tabbed Sidebar Layout (v1.7.0)
   ========================================================================== */

/* Design Tokens */
.ias-portal-page.ias-portal--tabbed {
    --ias-green: #2e7d32;
    --ias-green-light: #4caf50;
    --ias-green-dark: #1b5e20;
    --ias-green-bg: #e8f5e9;
    --ias-gray-50: #fafafa;
    --ias-gray-100: #f5f5f5;
    --ias-gray-200: #eeeeee;
    --ias-gray-300: #e0e0e0;
    --ias-gray-600: #757575;
    --ias-gray-800: #424242;
    --ias-radius-md: 8px;
    --ias-radius-sm: 4px;
    --ias-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --ias-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
}

/* Global Dashicons Reset — override WP default line-height: 20px */
.ias-portal-page .dashicons {
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
}

.ias-portal-page .dashicons::before {
    line-height: inherit;
}

/* Flash area above grid */
.ias-portal-flash-area:empty {
    display: none;
}

.ias-portal-flash-area {
    margin-bottom: 16px;
}

/* Sidebar + Content Grid */
.ias-portal-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    min-height: 500px;
    border: 1px solid var(--ias-gray-300);
    border-radius: var(--ias-radius-md);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--ias-shadow-sm);
}

/* Sidebar */
.ias-portal-sidebar {
    background: var(--ias-gray-50);
    border-right: 1px solid var(--ias-gray-200);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Sidebar Nav Button */
.ias-portal-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--ias-gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: all 150ms ease;
    border-left: 3px solid transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
}

.ias-portal-nav-btn:hover {
    background: var(--ias-gray-100);
    color: var(--ias-gray-800);
}

.ias-portal-nav-btn.is-active {
    background: #fff;
    color: var(--ias-green-dark);
    font-weight: 600;
    border-left-color: var(--ias-green);
}

.ias-portal-nav-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Nav Icon */
.ias-portal-nav-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: inherit;
}

.ias-portal-nav-btn.is-active .ias-portal-nav-icon {
    color: var(--ias-green);
}

/* Nav Label */
.ias-portal-nav-label {
    flex: 1;
}

/* Notification Dot */
.ias-portal-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ias-nav-dot--action {
    background: #ef4444;
    box-shadow: 0 0 0 2px var(--ias-gray-50);
}

/* Main Content Area */
.ias-portal-main {
    padding: 32px;
    min-height: 400px;
}

/* Tab Panes */
.ias-portal-tab-pane {
    display: none;
}

.ias-portal-tab-pane.is-active {
    display: block;
}

/* Tab Pane Header */
.ias-portal-tab-header {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

/* ==========================================================================
   Overview Tab — Cards
   ========================================================================== */

.ias-overview-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Status Card */
.ias-overview-status-card {
    padding: 24px;
    border-radius: var(--ias-radius-md);
    border: 1px solid var(--ias-gray-200);
}

.ias-overview-status-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.ias-overview-status-card p {
    margin: 0;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.ias-status-card--success {
    background: var(--ias-green-bg);
    border-color: #c8e6c9;
}

.ias-status-card--success h3 {
    color: var(--ias-green-dark);
}

.ias-status-card--info {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.ias-status-card--info h3 {
    color: #1565c0;
}

.ias-status-card--warning {
    background: #fff8e1;
    border-color: #ffe082;
}

.ias-status-card--warning h3 {
    color: #e65100;
}

.ias-status-card--neutral {
    background: var(--ias-gray-50);
    border-color: var(--ias-gray-300);
}

.ias-status-card--neutral h3 {
    color: var(--ias-gray-800);
}

.ias-status-card--error {
    background: #fef2f2;
    border-color: #fecaca;
}

.ias-status-card--error h3 {
    color: #991b1b;
}

/* Status Card Action Button */
.ias-status-card-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--ias-radius-md);
    cursor: pointer;
    transition: all 150ms ease;
    background: #fff;
    color: #333;
    border: 1px solid var(--ias-gray-300);
}

.ias-status-card-btn:hover {
    box-shadow: var(--ias-shadow-sm);
    background: #fafafa;
    text-decoration: none;
    color: #333;
}

.ias-status-card--warning .ias-status-card-btn {
    background: #e65100;
    color: #fff;
    border-color: #e65100;
}

.ias-status-card--warning .ias-status-card-btn:hover {
    background: #bf4400;
    border-color: #bf4400;
    color: #fff;
}

.ias-status-card--info .ias-status-card-btn {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.ias-status-card--info .ias-status-card-btn:hover {
    background: #0d47a1;
    border-color: #0d47a1;
    color: #fff;
}

.ias-status-card--success .ias-status-card-btn {
    background: var(--ias-green-dark);
    color: #fff;
    border-color: var(--ias-green-dark);
}

.ias-status-card--success .ias-status-card-btn:hover {
    background: #1a6b2b;
    border-color: #1a6b2b;
    color: #fff;
}

/* Event Quick Summary (Overview tab) */
.ias-overview-summary {
    padding: 20px 24px;
    background: var(--ias-gray-50);
    border-radius: var(--ias-radius-md);
    border: 1px solid var(--ias-gray-200);
}

.ias-overview-summary h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ias-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ias-overview-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ias-overview-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ias-overview-summary-label {
    font-size: 12px;
    color: var(--ias-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ias-overview-summary-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Contact Card (Overview tab) */
.ias-overview-contact {
    padding: 20px 24px;
    background: var(--ias-gray-50);
    border-radius: var(--ias-radius-md);
    border: 1px solid var(--ias-gray-200);
}

.ias-overview-contact h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ias-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ias-overview-contact p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.ias-overview-contact strong {
    color: #333;
}

/* ==========================================================================
   Contract Tab — Signed Confirmation
   ========================================================================== */

.ias-contract-signed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--ias-green-bg);
    border: 1px solid #c8e6c9;
    border-radius: var(--ias-radius-md);
    color: var(--ias-green-dark);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 20px;
}

.ias-contract-signed-badge svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Details Tab — Notes
   ========================================================================== */

.ias-detail-notes {
    background: var(--ias-gray-50);
    border: 1px solid var(--ias-gray-200);
    border-radius: var(--ias-radius-md);
    padding: 20px;
    margin-top: 20px;
}

.ias-detail-notes h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.ias-detail-notes p {
    margin: 0;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tabbed layout responsive — mobile becomes horizontal tabs */
@media screen and (max-width: 768px) {
    .ias-portal-page.ias-portal--tabbed {
        padding: 15px 10px 30px;
    }

    .ias-portal-layout {
        grid-template-columns: 1fr;
    }

    .ias-portal-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--ias-gray-200);
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .ias-portal-nav-btn {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        font-size: 12px;
        min-width: 0;
        flex: 1;
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .ias-portal-nav-btn.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--ias-green);
    }

    .ias-portal-nav-icon {
        width: 18px;
        height: 18px;
    }

    .ias-portal-nav-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        margin-left: 0;
    }

    .ias-portal-main {
        padding: 20px 16px;
    }

    .ias-overview-summary-grid {
        grid-template-columns: 1fr;
    }

}

@media screen and (max-width: 600px) {
    .ias-contract-page {
        margin: 20px auto;
    }

    .ias-signature-section {
        padding: 20px;
    }

    .ias-contract-pdf-embed iframe {
        height: 400px;
    }

    .ias-contract-action-banner {
        padding: 16px;
        gap: 12px;
    }

    .ias-contract-action-icon {
        width: 36px;
        height: 36px;
    }

    .ias-contract-action-icon svg {
        width: 18px;
        height: 18px;
    }

    .ias-contract-action-text strong {
        font-size: 14px;
    }

    .ias-contract-action-text p {
        font-size: 13px;
    }

    .ias-payment-action-banner {
        padding: 16px;
        gap: 12px;
    }

    .ias-payment-action-icon {
        width: 36px;
        height: 36px;
    }

    .ias-payment-action-icon svg {
        width: 18px;
        height: 18px;
    }

    .ias-payment-action-text strong {
        font-size: 14px;
    }

    .ias-payment-action-text p {
        font-size: 13px;
    }

    .ias-portal-pay-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ias-typed-signature-preview {
        font-size: 24px;
    }

    .ias-contract-step {
        padding: 16px;
    }

    .ias-contract-step-header h3 {
        font-size: 16px;
    }

    .ias-contract-pdf-embed--compact iframe {
        height: 300px;
    }

    .ias-contract-unsigned-placeholder {
        padding: 40px 16px;
    }

    .ias-payment-method-card {
        padding: 20px;
    }

    /* Portal responsive */
    .ias-portal-page {
        padding: 15px 15px 30px;
    }

    .ias-portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ias-portal-title {
        font-size: 22px;
    }

    .ias-portal-progress {
        margin: 15px 0 25px;
    }

    .ias-portal-progress::before {
        left: 12px;
        right: 12px;
    }

    .ias-progress-dot {
        width: 20px;
        height: 20px;
    }

    .ias-progress-label {
        font-size: 10px;
    }

    .ias-portal-section h2 {
        font-size: 20px;
    }

    .ias-success-notice,
    .ias-warning-notice {
        padding: 15px 18px;
    }

    .ias-event-summary {
        padding: 15px;
    }

    .ias-event-summary th {
        width: 120px;
    }

    .ias-event-summary th,
    .ias-event-summary td {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* Payment Schedule responsive */
    .ias-portal-schedule-table thead {
        display: none;
    }

    .ias-portal-schedule-table,
    .ias-portal-schedule-table tbody,
    .ias-portal-schedule-table tr,
    .ias-portal-schedule-table td {
        display: block;
    }

    .ias-portal-schedule-table tbody tr {
        margin-bottom: 12px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 12px;
    }

    .ias-portal-schedule-table tbody td {
        padding: 4px 0;
        border-bottom: none;
        font-size: 14px;
    }

    .ias-portal-schedule-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 11px;
        text-transform: uppercase;
        display: block;
        margin-bottom: 2px;
    }

    .ias-portal-schedule-table tbody td:empty::before {
        display: none;
    }

    .ias-portal-schedule-action {
        text-align: left !important;
        margin-top: 8px;
    }

    .ias-portal-schedule-summary {
        flex-direction: column;
        gap: 10px;
    }

    .ias-portal-schedule-stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

}

/* =========================================
   Contract Comments (Portal)
   ========================================= */

.ias-contract-comments {
    margin-top: 32px;
    border-top: 1px solid #e0e0e0;
    padding-top: 24px;
}

.ias-contract-comments h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.ias-comment-list {
    margin-bottom: 24px;
}

.ias-comment-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.ias-comment-item:last-child {
    margin-bottom: 0;
}

.ias-comment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ias-comment-item-author {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.ias-comment-item-date {
    font-size: 12px;
    color: #888;
}

.ias-comment-item-body {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    white-space: pre-wrap;
}

.ias-comment-form {
    margin-top: 16px;
}

.ias-comment-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ias-comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ias-comment-form textarea:focus {
    border-color: var(--ias-portal-primary, #7e0d0d);
    outline: none;
    box-shadow: 0 0 0 2px rgba(126, 13, 13, 0.1);
}

.ias-comment-form .button {
    margin-top: 10px;
}

/* =========================================
   Contract Signing Layout (Action Items)
   Two-column: contract main + comments sidebar
   ========================================= */

.ias-contract-signing-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.ias-contract-signing-main {
    min-width: 0;
}

/* Sticky sidebar */
.ias-contract-comments-sidebar {
    min-width: 0;
}

.ias-contract-comments-sticky {
    position: sticky;
    top: 32px;
    background: #fafbfc;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
}

.ias-contract-comments-sticky h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.ias-comments-sidebar-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.ias-contract-comments-sticky .ias-comment-list {
    margin-bottom: 16px;
}

.ias-contract-comments-sticky .ias-comment-item {
    padding: 10px 12px;
    font-size: 13px;
}

.ias-contract-comments-sticky .ias-comment-form {
    margin-top: 0;
}

.ias-contract-comments-sticky .ias-comment-form textarea {
    font-size: 13px;
    padding: 10px;
}

.ias-contract-comments-sticky .ias-comment-form .button {
    width: 100%;
}

/* Stack on tablet/mobile */
@media screen and (max-width: 900px) {
    .ias-contract-signing-layout {
        grid-template-columns: 1fr;
    }

    .ias-contract-comments-sticky {
        position: static;
    }
}

/* ==========================================================================
   Post-Event Adjustment Badges (Portal)
   ========================================================================== */

.ias-portal-adjustment-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #e8eaf6;
    color: #3949ab;
    padding: 1px 6px;
    border-radius: 3px;
    vertical-align: middle;
}

.ias-portal-adjustment-desc {
    color: #777;
    font-style: italic;
}
