 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
 }

 body {
     font-family: Arial, sans-serif;
     height: 100vh;
     overflow: hidden;
 }

 .container {
     display: flex;
     height: 100vh;
 }

/* Left Panel - ~15% narrower than legacy 250px width */
/* Left Panel - ~15% narrower than legacy 250px width */
.left-panel {
    width: 212px;
     background-color: #f5f5f5;
     border-right: 1px solid #ddd;
     flex-shrink: 0;
     display: flex;
     flex-direction: column;
     height: 100vh;
     overflow: hidden;
 }

 /* Top Section - 1/3 of left panel */
 .left-panel-top {
     flex: 1;
     border-bottom: 1px solid #ddd;
     background-color: #f9f9f9;
     display: flex;
     flex-direction: column;
 }

 /* Bottom Section - 2/3 of left panel */
 .left-panel-bottom {
     flex: 2;
     background-color: #f5f5f5;
     display: flex;
     flex-direction: column;
 }

 /* Action buttons row */
 .panel-actions {
     background-color: #e0e0e0;
     padding: 5px 5px;
     border-top: 1px solid #ccc;
     display: flex;
     justify-content: space-around;
     align-items: center;
     flex-shrink: 0;
 }

 .panel-actions button {
     background: none;
     border: none;
     cursor: pointer;
     padding: 3px;
     border-radius: 2px;
     transition: background-color 0.2s;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .panel-actions button:hover {
     background-color: rgba(0, 0, 0, 0.1);
 }

 .panel-actions button img {
     width: 20px;
     height: 24px;
 }

 .panel-actions .report-help-button {
     width: 28px;
     height: 28px;
     padding: 0;
     border: 1px solid #b7bec8;
     border-radius: 999px;
     background: #ffffff;
     color: #0f172a;
     font-size: 18px;
     font-weight: 700;
     line-height: 1;
     flex-shrink: 0;
 }

 .panel-actions .report-help-button:hover {
     background: #eff6ff;
     border-color: #7aa2e3;
 }

 .sr-only {
     position: absolute;
     width: 1px;
     height: 1px;
     padding: 0;
     margin: -1px;
     overflow: hidden;
     clip: rect(0, 0, 0, 0);
     white-space: nowrap;
     border: 0;
 }

 /* Fixed headings for panels */
 .panel-heading {
     background-color: #e0e0e0;
     padding: 5px 5px;
     font-weight: bold;
     font-size: 14px;
     border-bottom: 1px solid #ccc;
     flex-shrink: 0;
 }

 /* Content area for panels */
 .panel-content {
     flex: 1;
     padding: 10px;
     overflow-y: auto;
 }

 /* Right Side - iFrame Container */
 .right-side {
     flex: 1;
     overflow: hidden;
     background-color: #ffffff;
     position: relative;
 }

 /* iFrame Styling */
 #contentFrame {
     width: 100%;
     height: 100%;
     border: none;
     display: block;
 }

 /* Progress Bar Container */
 .progress-container {
     position: absolute;
     top: 60px;
     right: 10px;
     width: 300px;
     background-color: white;
     border: 1px solid #ddd;
     border-radius: 4px;
     padding: 15px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
     display: none;
     z-index: 10;
 }

 .progress-container.show {
     display: block;
 }

 .progress-header {
     font-size: 14px;
     font-weight: bold;
     margin-bottom: 10px;
     color: #333;
 }

 .progress-status {
     font-size: 12px;
     color: #666;
     margin-bottom: 8px;
 }

 .progress-bar-wrapper {
     width: 100%;
     height: 20px;
     background-color: #f0f0f0;
     border-radius: 10px;
     overflow: hidden;
     position: relative;
 }

 .progress-bar {
     height: 100%;
     background-color: #ff6b35;
     width: 0%;
     transition: width 0.3s ease;
     border-radius: 10px;
 }

 .progress-percentage {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     font-size: 11px;
     font-weight: bold;
     color: #333;
 }

 .progress-close {
     position: absolute;
     top: 10px;
     right: 10px;
     background: none;
     border: none;
     font-size: 18px;
     cursor: pointer;
     color: #999;
     line-height: 1;
     padding: 0;
     width: 20px;
     height: 20px;
 }

 .progress-close:hover {
     color: #333;
 }

 /* Mobile Responsive */
 @media (max-width: 768px) {
     .container {
         flex-direction: column;
     }

     .left-panel {
         width: 100%;
         height: 150px;
         border-right: none;
         border-bottom: 1px solid #ddd;
         flex-direction: row;
     }

     .left-panel-top {
         flex: 1;
         border-bottom: none;
         border-right: 1px solid #ddd;
     }

     .left-panel-bottom {
         flex: 2;
     }

     .right-side {
         height: calc(100vh - 150px);
     }
 }

/* PDF subset selection modal */
.pdf-select-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.ez-help-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1200;
}

.ez-help-overlay.open {
    display: flex;
}

.ez-help-dialog {
    width: min(460px, calc(100vw - 28px));
    height: min(680px, calc(100vh - 32px));
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ez-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
}

.ez-help-title-block {
    min-width: 0;
}

.ez-help-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.ez-help-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #475569;
}

.ez-help-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ez-help-header-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

.ez-help-header-btn:hover {
    background: #f8fafc;
}

.ez-help-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.ez-help-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f8fafc;
}

.ez-help-status {
    min-height: 20px;
    padding: 10px 16px 0;
    font-size: 12px;
    color: #475569;
}

.ez-help-status.error {
    color: #b91c1c;
}

.ez-help-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 8px;
}

.ez-help-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}

.ez-help-chip:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.ez-help-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ez-help-message {
    display: flex;
}

.ez-help-message.assistant {
    justify-content: flex-start;
}

.ez-help-message.user {
    justify-content: flex-end;
}

.ez-help-bubble {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.ez-help-message.assistant .ez-help-bubble {
    background: #ffffff;
    color: #0f172a;
    border-top-left-radius: 6px;
}

.ez-help-message.user .ez-help-bubble {
    background: #1d4ed8;
    color: #ffffff;
    border-top-right-radius: 6px;
}

.ez-help-compose {
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ez-help-textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #0f172a;
}

.ez-help-textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.ez-help-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ez-help-context {
    font-size: 11px;
    color: #64748b;
}

.ez-help-send {
    border: 0;
    border-radius: 12px;
    background: #1d4ed8;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ez-help-send:hover {
    background: #1e40af;
}

.ez-help-send:disabled,
.ez-help-chip:disabled,
.ez-help-header-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.pdf-select-overlay.show {
    display: flex;
}

.pdf-select-modal {
    width: min(520px, 92vw);
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
}

.pdf-select-header h3 {
    margin: 0;
    font-size: 15px;
}

.pdf-select-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

.pdf-select-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.pdf-select-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pdf-select-action-btn {
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.pdf-select-list {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    overflow-y: auto;
    max-height: 44vh;
}

.pdf-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 13px;
}

.pdf-select-item input {
    margin: 0;
}

.pdf-select-footer {
    padding: 12px 16px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pdf-select-btn {
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.pdf-select-btn.primary {
    background: #2f6fed;
    border-color: #2f6fed;
    color: #fff;
}

.pdf-select-btn.primary:hover {
    background: #255ed0;
}

.pdf-suffix-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.pdf-suffix-help {
    font-size: 12px;
    color: #555;
}

.pdf-suffix-help.muted {
    color: #777;
}

.pdf-suffix-versions {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-suffix-versions-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.pdf-suffix-versions-list {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    background: #fafafa;
    max-height: 26vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdf-suffix-version-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.pdf-suffix-version-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pdf-suffix-version-name {
    word-break: break-all;
    color: #333;
    line-height: 1.25;
}

.pdf-suffix-version-time {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.2;
}

.pdf-suffix-version-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.pdf-suffix-btn {
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
}

.pdf-suffix-btn.open {
    color: #2f6fed;
    border-color: #2f6fed;
    background: #f2f7ff;
}

.pdf-suffix-btn.delete {
    color: #b00020;
    border-color: #b00020;
    background: #fff5f5;
}

.pdf-suffix-empty {
    font-size: 12px;
    color: #777;
    padding: 4px 2px;
}

.email-settings-modal {
    width: min(560px, 94vw);
}

.email-settings-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 12px;
    align-items: center;
}

.email-settings-label {
    font-size: 12px;
    color: #444;
    font-weight: 600;
}

.email-settings-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

.email-settings-textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    resize: vertical;
}

.email-settings-preview {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.email-settings-preview-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.email-settings-preview-body {
    font-size: 12px;
    line-height: 1.4;
    color: #222;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.email-settings-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
}


 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
 }

 body {
     font-family: Arial, sans-serif;
     height: 100vh;
     overflow: hidden;
 }

 .container {
     display: flex;
     height: 100vh;
 }

/* Left Panel - ~15% narrower than legacy 250px width */
/* Left Panel - ~15% narrower than legacy 250px width */
.left-panel {
    width: 212px;
     background-color: #f5f5f5;
     border-right: 1px solid #ddd;
     flex-shrink: 0;
     display: flex;
     flex-direction: column;
     height: 100vh;
     overflow: hidden;
 }

 /* Top Section - 1/3 of left panel */
 .left-panel-top {
     flex: 1;
     border-bottom: 1px solid #ddd;
     background-color: #f9f9f9;
     display: flex;
     flex-direction: column;
     /* Add overflow for scrolling */
     overflow-y: auto;
     /* <--- ADDED THIS LINE */
 }

 /* Bottom Section - 2/3 of left panel */
 .left-panel-bottom {
     flex: 2;
     background-color: #f5f5f5;
     display: flex;
     flex-direction: column;
     /* Add overflow for scrolling */
     overflow-y: auto;
     /* <--- ADDED THIS LINE */
 }

 /* Action buttons row */
 .panel-actions {
     background-color: #e0e0e0;
     border-top: 1px solid #ccc;
     display: flex;
     justify-content: space-around;
     align-items: center;
     flex-shrink: 0;
 }

 .panel-actions button {
     background: none;
     border: none;
     cursor: pointer;
     padding: 5px;
     border-radius: 4px;
     transition: background-color 0.2s;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .panel-actions button:hover {
     background-color: rgba(0, 0, 0, 0.1);
 }

 .panel-actions button img {
     width: 24px;
     height: 24px;
 }

 /* Fixed headings for panels */
 .panel-heading {
     background-color: #e0e0e0;
     padding: 8px 10px;
     font-weight: bold;
     font-size: 14px;
     border-bottom: 1px solid #ccc;
     flex-shrink: 0;
 }

 /* Content area for panels */
 .panel-content {
     flex: 1;
     padding: 10px;
     /* This property was already here, but the parent flex containers needed overflow-y: auto too */
     overflow-y: auto;
 }

 /* Right Side - iFrame Container */
 .right-side {
     flex: 1;
     overflow: hidden;
     background-color: #ffffff;
     position: relative;
     display: flex;
     flex-direction: column;
 }

 /* Smart Tab Container */
 #iframeContainer {
     flex: 1;
     position: relative;
     overflow: hidden;
 }

 /* iFrame Styling */
 #contentFrame,
 .smart-iframe {
     width: 100%;
     height: 100%;
     border: none;
     display: block;
 }

 /* Smart Tab Bar */
 #smartTabBar {
     display: none;
     background: #f5f5f5;
     border-bottom: 2px solid #ddd;
     padding: 0;
     min-height: 36px;
     overflow-x: auto;
     overflow-y: hidden;
 }

 .smart-tab {
     display: inline-flex;
     align-items: center;
     padding: 8px 12px;
     background: #e0e0e0;
     border: 1px solid #ccc;
     border-bottom: none;
     border-radius: 6px 6px 0 0;
     margin-right: 2px;
     cursor: grab;
     font-size: 13px;
     white-space: nowrap;
     transition: background 0.2s;
     position: relative;
     top: 2px;
 }

 .smart-tab:hover {
     background: #d0d0d0;
 }

 .smart-tab:active {
     cursor: grabbing;
 }

 .smart-tab.active {
     background: #ffffff;
     border-bottom: 2px solid #ffffff;
     font-weight: 600;
     top: 2px;
     z-index: 1;
 }

 .smart-tab-label {
     margin-right: 8px;
     max-width: 150px;
     overflow: hidden;
     text-overflow: ellipsis;
 }

 .smart-tab-close {
     display: flex;
     align-items: center;
     justify-content: center;
     width: 16px;
     height: 16px;
     border-radius: 3px;
     font-size: 14px;
     line-height: 1;
     color: #666;
     transition: all 0.2s;
 }

 .smart-tab-close:hover {
     background: rgba(244, 67, 54, 0.2);
     color: #f44336;
 }

 /* Drag and drop feedback */
 .smart-tab.dragging {
     opacity: 0.5;
     cursor: grabbing;
 }

 .smart-tab.drag-over-left {
     border-left: 3px solid #4CAF50;
 }

 .smart-tab.drag-over-right {
     border-right: 3px solid #4CAF50;
 }

 /* Progress Bar Container */
 .progress-container {
     position: absolute;
     top: 60px;
     right: 10px;
     width: 300px;
     background-color: white;
     border: 1px solid #ddd;
     border-radius: 4px;
     padding: 15px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
     display: none;
     z-index: 10;
 }

 .progress-container.show {
     display: block;
 }

 .progress-header {
     font-size: 14px;
     font-weight: bold;
     margin-bottom: 10px;
     color: #333;
 }

 .progress-status {
     font-size: 12px;
     color: #666;
     margin-bottom: 8px;
 }

 .progress-bar-wrapper {
     width: 100%;
     height: 20px;
     background-color: #f0f0f0;
     border-radius: 10px;
     overflow: hidden;
     position: relative;
 }

 .progress-bar {
     height: 100%;
     background-color: #ff6b35;
     width: 0%;
     transition: width 0.3s ease;
     border-radius: 10px;
 }

 .progress-percentage {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     font-size: 11px;
     font-weight: bold;
     color: #333;
 }

 .progress-close {
     position: absolute;
     top: 10px;
     right: 10px;
     background: none;
     border: none;
     font-size: 18px;
     cursor: pointer;
     color: #999;
     line-height: 1;
     padding: 0;
     width: 20px;
     height: 20px;
 }

 .progress-close:hover {
     color: #333;
 }

 /* Mobile Responsive */
 @media (max-width: 768px) {
     .container {
         flex-direction: column;
     }

     .left-panel {
         width: 100%;
         height: 150px;
         border-right: none;
         border-bottom: 1px solid #ddd;
         flex-direction: row;
     }

     .left-panel-top {
         flex: 1;
         border-bottom: none;
         border-right: 1px solid #ddd;
     }

     .left-panel-bottom {
         flex: 2;
     }

     .right-side {
         height: calc(100vh - 150px);
     }

     .ez-help-dialog {
         width: calc(100vw - 16px);
         height: calc(100vh - 16px);
         border-radius: 14px;
     }

     .ez-help-bubble {
         max-width: 94%;
     }
 }


 /* New styles for collapsable panels */
 .panel-heading {
     cursor: pointer;
     /* Indicate it's clickable */
     user-select: none;
     /* Prevent text selection on double-click */
     flex-shrink: 0;
     /* Prevents heading from shrinking */
     display: flex;
     /* Make it a flex container to center text */
     align-items: center;
     /* Vertically center text */
     padding: 8px 10px;
     /* Restore original padding */
 }

 .panel-content.collapsed {
     display: none;
     /* This correctly hides the content */
 }

 /* Optional: Visual feedback for collapsed heading */
 .collapsed-heading {
     background-color: #d0d0d0;
     /* Slightly darker */
     border-bottom-color: #a0a0a0;
 }

 .collapsed-heading:hover {
     background-color: #c0c0c0;
     /* Darker on hover */
 }

 /* Styles for the parent panel when its content is collapsed */
 /* This ensures the parent panel shrinks to only the heading's height, without hiding the heading itself */
 .left-panel-top.panel-collapsed,
 .left-panel-bottom.panel-collapsed {
     flex-grow: 0;
     /* Prevents the panel from taking up extra space */
     flex-shrink: 0;
     /* Prevents the panel from shrinking more than its content */
     height: 40px;
     /* Explicitly set height to match the heading's min-height */
     overflow: hidden;
     /* Hide any content that overflows this fixed height */
     /* Ensure children (heading and content) are laid out correctly */
     display: flex;
     flex-direction: column;
 }

 .hidden {
     display: none !important;
 }


 /* REMOVE these old rules from report.css */
 .left-panel-top {
     /* ... old styles ... */
 }

 .left-panel-bottom {
     /* ... old styles ... */
 }

 /* ADD this new rule to report.css */
 .panel-section {
     flex: 1;
     /* This makes each panel take up an equal amount of space */
     display: flex;
     flex-direction: column;
     min-height: 40px;
     /* Ensures the heading is always visible */
     border-bottom: 1px solid #ddd;
     background-color: #f9f9f9;
 }

 /* This makes sure the last panel doesn't have a bottom border */
 .panel-section:last-child {
     border-bottom: none;
 }

 /* This ensures the content area within each panel can scroll if needed */
 .panel-section>.panel-content {
     flex-grow: 1;
     overflow-y: auto;
 }


 /* src/report.css - Add these styles */

 /* --- Template System Styles --- */

 /* Style for the "Create New Template" button */
 #new-template-btn {
     display: block;
     width: calc(100% - 20px);
     margin: 3px;
     padding: 3px;
     font-size: 14px;
     font-weight: bold;
     color: #333;
     background-color: #e0e0e0;
     border: 1px solid #ccc;
     border-radius: 2px;
     cursor: pointer;
     text-align: center;
     transition: background-color 0.2s;
 }

 #new-template-btn:hover {
     background-color: #d5d5d5;
 }

 /* Container for the list of saved templates */
 #template-list-container {
     padding: 0 10px 10px 10px;
     display: flex;
     flex-direction: column;
     gap: 8px;
     /* Spacing between template items */
 }

 /* Individual template item, styled to match your screenshot */
 .template-item {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 6px 6px;
     background-color: #e9f2ff;
     /* Light blue background */
     border: 1px solid #b0c4de;
     /* Light steel blue border */
     border-radius: 2px;
     font-size: 14px;
     cursor: pointer;
     transition: background-color 0.2s, border-color 0.2s;
 }

 .template-item:hover {
     background-color: #d8e6fa;
     border-color: #9cb3d1;
 }

 /* The main name area of the template item */
 .template-name-area {
     flex-grow: 1;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     /* Adds "..." if the name is too long */
 }

 /* Container for the action icons on the right */
 .template-actions-area {
     display: flex;
     align-items: center;
     gap: 8px;
     margin-left: 10px;
 }

 /* Individual action button (for update, delete) */
 .template-action-btn {
     background: none;
     border: none;
     font-size: 16px;
     cursor: pointer;
     padding: 2px;
     opacity: 0.6;
     transition: opacity 0.2s;
 }

 .template-action-btn:hover {
     opacity: 1;
 }


 /* Template Panel Styles */
 #appraisalTemplatesContent {
     display: flex;
     flex-direction: column;
     /* Removed height: 100% to allow content to determine height and enable scrolling */
     padding: 0;
     position: relative;
     /* Ensure proper stacking context */
     min-height: 0;
     /* Allow flex container to shrink */
 }

 #template-list-container {
     flex: 1;
     overflow-y: auto;
     padding: 10px 0;
 }

 /* Signature button wrapper - ensure it's always visible and not covered */
 #signButton,
 #signatureButton,
 [id*="signature"][style*="display:flex"] {
     position: relative;
     z-index: 2;
     /* Higher than timeMachine */
 }

 /* Time Machine container - lower z-index */
 #timeMachineContainer {
     position: relative;
     z-index: 1;
 }

 /* Create New Template Button - At Bottom */
 #new-template-btn {
     margin-top: auto;
     padding: 3px;
     background-color: rgb(232, 244, 255);
     color: black;
     border: none;
     cursor: pointer;
     font-size: 14px;
     font-weight: 250;
     text-align: center;
     border-top: 1px solid #ddd;
 }

 #new-template-btn:hover {
     background-color: #45a049;
 }

 /* Template Item - Match Report Forms Style */
 .template-item {
     display: flex;
     align-items: stretch;
     margin: 0 5px 5px 5px;
     height: 32px;
     background-color: #e8f5e9;
     border: 1px solid #4CAF50;
 }

 .template-name-area {
     flex: 1;
     padding: 0 10px;
     display: flex;
     align-items: center;
     cursor: pointer;
     font-size: 13px;
     background-color: #e8f5e9;
 }

 .template-name-area:hover {
     background-color: #c8e6c9;
 }

 .template-actions-area {
     display: flex;
     align-items: stretch;
 }

 .template-action-btn {
     width: 30px;
     padding: 0;
     background-color: transparent;
     border: none;
     border-left: 1px solid #4CAF50;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .template-action-btn:hover {
     background-color: rgba(0, 0, 0, 0.05);
 }

 .template-action-btn svg {
     width: 16px;
     height: 16px;
 }

 /* Icon styles */
 .icon-upload {
     stroke: #4CAF50;
     fill: none;
     stroke-width: 2;
 }

 .icon-download {
     stroke: #2196F3;
     fill: none;
     stroke-width: 2;
 }

 .icon-delete {
     stroke: #f44336;
     fill: none;
     stroke-width: 2;
 }




 /* ===== Toast Notification Styles ===== */
.toast-notification {
    position: fixed;
    padding: 5px 5px;
    border-radius: 2px;
    background-color: #2c3e50;
     /* Default dark background */
     color: #ffffff;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     font-size: 16px;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     opacity: 0;
     transform: translateY(20px);
     transition: opacity 0.3s ease, transform 0.3s ease;
     z-index: 10000;
    max-width: 320px;
    text-align: center;
}

.toast-notification.toast-has-close {
    padding-right: 28px;
}

.toast-message {
    display: block;
    white-space: pre-line;
}

.toast-close {
    position: absolute;
    top: 2px;
    right: 6px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

 .toast-notification.show {
     opacity: 1;
     transform: translateY(0);
 }

 /* --- Positioning --- */
 .toast-bottom-right {
     bottom: 20px;
     right: 50px !important;
 }

 .toast-bottom-left {
     bottom: 20px;
     left: 20px;
 }

 .toast-top-right {
     top: 20px;
     right: 50px !important;
 }

 .toast-top-left {
     top: 20px;
     left: 20px;
 }

 /* --- Types --- */
 .toast-success {
     background-color: #27ae60;
     /* Green */
 }

 .toast-error {
     background-color: #c0392b;
     /* Red */
 }

 .toast-warning {
     background-color: #f39c12;
     /* Yellow */
 }

.toast-info {
    background-color: #2980b9;
    /* Blue */
}

.toast-notification.toast-save-cloud {
    background-color: #2563eb;
}

.toast-notification.toast-save-local {
    background-color: #16a34a;
}

/* ===== PDF Timing Toast (persistent) ===== */
.pdf-timing-toast-container {
    position: fixed;
    bottom: 20px;
    right: 50px;
    z-index: 12001;
}

.pdf-timing-toast {
    position: relative;
    padding: 8px 28px 8px 10px;
    border-radius: 2px;
    background-color: #2c3e50;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 360px;
    white-space: pre-line;
}

.pdf-timing-toast-close {
    position: absolute;
    top: 2px;
    right: 6px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

 /* ... (rest of your existing CSS) ... */
