/* ==========================================================================
   P CALENDAR PRO - MODALS, TOASTS & PROFESSIONAL PRINT PDF STYLES
   ========================================================================== */

/* Full Screen Google Auth Gate Wall */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.4s ease-out;
}

.auth-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.auth-icon-badge {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.25rem auto;
    box-shadow: var(--shadow-glow);
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: white;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    min-height: 50px;
}

.demo-auth-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.demo-auth-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

/* User Profile Header Pill */
.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 4px 12px 4px 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.user-email {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.btn-signout {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-signout:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

/* Glass Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-box {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.close-btn {
    border: none;
    background: var(--bg);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field input, .field select, .field textarea {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    background: var(--surface);
    transition: var(--transition);
}

.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.field input.calculated {
    background: #f8fafc;
    font-weight: 800;
    color: var(--primary);
}

.modal-actions-bar {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.party-communication-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-call { background: #16a34a; color: white; border: none; }
.btn-whatsapp { background: #059669; color: white; border: none; }
.btn-sms { background: #0284c7; color: white; border: none; }
.btn-share { background: var(--primary); color: white; border: none; }
.btn-complete { background: var(--success); color: white; border: none; }

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #0f172a;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--success);
}

.toast.toast-info { border-left-color: var(--info); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger { border-left-color: var(--danger); }

/* Report Styles (Screen) */
.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-metric {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
}

.report-metric span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
}

.report-metric h3 {
    font-size: 1.35rem;
    margin-top: 6px;
    color: var(--text-main);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.report-table th, .report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.85rem;
}

.report-table th {
    background: #f8fafc;
    font-weight: 800;
    color: var(--text-muted);
}

/* ==========================================================================
   ENTERPRISE PRINTABLE DOCUMENT & PDF FORMATTING STYLES
   ========================================================================== */
#printContainer {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 12mm 12mm 12mm;
    }

    body {
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body * {
        visibility: hidden;
    }

    #printContainer, #printContainer * {
        visibility: visible;
    }

    #printContainer {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: #ffffff;
    }
}

.pdf-document {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: #0f172a;
    background: #ffffff;
    padding: 10px;
    max-width: 100%;
}

/* Letterhead Header */
.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #4f46e5;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.pdf-brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pdf-logo {
    max-height: 55px;
    max-width: 160px;
    object-fit: contain;
}

.pdf-company-title {
    font-size: 18pt;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.pdf-company-sub {
    font-size: 9pt;
    color: #64748b;
    font-weight: 600;
}

.pdf-doc-meta {
    text-align: right;
}

.pdf-doc-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 10pt;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.pdf-meta-line {
    font-size: 8.5pt;
    color: #64748b;
    margin-top: 2px;
}

.pdf-meta-line b {
    color: #0f172a;
}

/* Summary Grid Cards */
.pdf-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pdf-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
}

.pdf-card-label {
    font-size: 7.5pt;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-card-val {
    font-size: 13pt;
    font-weight: 800;
    color: #0f172a;
    margin-top: 4px;
}

.pdf-card-val.green { color: #059669; }
.pdf-card-val.blue { color: #2563eb; }
.pdf-card-val.red { color: #dc2626; }
.pdf-card-val.purple { color: #7c3aed; }

/* Sections & Tables */
.pdf-section-title {
    font-size: 10.5pt;
    font-weight: 800;
    color: #334155;
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 6px;
    margin-bottom: 12px;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.pdf-info-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.pdf-info-block h4 {
    font-size: 9pt;
    font-weight: 800;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.pdf-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 8.5pt;
    margin-bottom: 4px;
}

.pdf-info-row span:first-child {
    color: #64748b;
    font-weight: 600;
}

.pdf-info-row span:last-child {
    font-weight: 700;
    color: #0f172a;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.pdf-table th {
    background: #4f46e5;
    color: #ffffff;
    font-size: 8.5pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    text-align: left;
}

.pdf-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 8.5pt;
    color: #1e293b;
}

.pdf-table tr:nth-child(even) td {
    background: #f8fafc;
}

.pdf-table tfoot td {
    background: #eef2ff !important;
    font-weight: 800;
    color: #4f46e5;
    font-size: 9pt;
    border-top: 2px solid #818cf8;
    border-bottom: 2px solid #818cf8;
}

.pdf-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 7.5pt;
    font-weight: 800;
    text-transform: uppercase;
}

.pdf-status-booked { background: #dbeafe; color: #1e40af; }
.pdf-status-intransit { background: #fef3c7; color: #92400e; }
.pdf-status-completed { background: #d1fae5; color: #065f46; }

/* Terms & Footer Signatures */
.pdf-terms {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.pdf-terms h5 {
    font-size: 8pt;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pdf-terms ul {
    margin-left: 16px;
    font-size: 7.5pt;
    color: #64748b;
}

.pdf-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 30px;
    padding-top: 10px;
}

.pdf-sign-box {
    text-align: center;
    width: 200px;
}

.pdf-sign-line {
    border-top: 1.5px solid #0f172a;
    padding-top: 4px;
    font-size: 8.5pt;
    font-weight: 800;
    color: #0f172a;
}
