#chatAIModal {
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), top 0.2s ease-out;
  border-left: 1px solid #dee2e6;
  overflow: hidden;
  pointer-events: auto;
  bottom: 0px;
}

#chatAIModal {
  position: fixed;
  top: 164px;
  right: -25%;
  width: 25%;
  background: white;
  z-index: 1050;
}

#chatAIModal.scrolled {
  top: 72px;
}

#chatAIModal.show {
  right: 0;
}

#chatAIModal .modal-dialog {
  margin: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  position: relative;
}

#chatAIModal .modal-content {
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#chatAIModal .modal-body {
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.content {
  transition: padding-right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body:has(#chatAIModal.show) .content {
  padding-right: calc(25% + 30px) !important;
}

body:has(#chatAIModal.show.scrolled) .content {
  padding-right: calc(25% + 30px) !important;
}

#chatAIModal.show ~ * [style*="position: fixed"][style*="bottom"],
#chatAIModal.show ~ button[style*="position: fixed"][style*="bottom"],
button#back-to-top,
a.btn--action,
.btn.btn--action {
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body:has(#chatAIModal.show) button[style*="position: fixed"][style*="bottom"],
body:has(#chatAIModal.show) a.btn--action,
body:has(#chatAIModal.show) .btn.btn--action,
body:has(#chatAIModal.show) button#back-to-top {
  right: calc(25% + 43px) !important;
}

@media (max-width: 1200px) {
  body:has(#chatAIModal.show) button[style*="position: fixed"][style*="bottom"],
  body:has(#chatAIModal.show) a.btn--action,
  body:has(#chatAIModal.show) .btn.btn--action,
  body:has(#chatAIModal.show) button#back-to-top {
    right: calc(30% + 40px) !important;
  }
}

@media (max-width: 991px) {
  body:has(#chatAIModal.show) button[style*="position: fixed"][style*="bottom"],
  body:has(#chatAIModal.show) a.btn--action,
  body:has(#chatAIModal.show) .btn.btn--action,
  body:has(#chatAIModal.show) button#back-to-top {
    right: calc(40% + 50px) !important;
  }
}

@media (max-width: 768px) {
  body:has(#chatAIModal.show) button[style*="position: fixed"][style*="bottom"],
  body:has(#chatAIModal.show) a.btn--action,
  body:has(#chatAIModal.show) .btn.btn--action,
  body:has(#chatAIModal.show) button#back-to-top {
    display: none;
  }
}

.procedure-show-wrapper {
  display: flex;
  position: relative;
}

.procedure-content {
  flex: 1;
  overflow-y: auto;
  transition: max-width 0.3s ease-in-out, margin-right 0.3s ease-in-out;
  max-width: 100%;
}

.procedure-content.with-chat-panel {
  margin-right: 25%;
  max-width: 100%;
}

.chat-panel-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1100;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #FFFFFF;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.chat-panel-close-btn:hover {
  background-color: #0866bf;
}

@media (min-width: 1201px) {
  #chatAIModal {
    width: 25%;
    right: -25%;
  }
  
  body:has(#chatAIModal.show) .content {
    padding-right: calc(25% + 30px) !important;
  }
}

@media (max-width: 1200px) {
  #chatAIModal {
    width: 30%;
    right: -30%;
  }
  
  body:has(#chatAIModal.show) .content {
    padding-right: calc(30% + 30px) !important;
  }
  
  .chat-component {
    height: calc(100vh - 164px);
  }
  
  .chat-header {
    padding: 1rem 1.5rem;
  }
  
  .chat-title-logo {
    height: 28px !important;
  }
}

@media (max-width: 991px) {
  #chatAIModal {
    width: 40%;
    right: -40%;
  }
  
  body:has(#chatAIModal.show) .content {
    padding-right: calc(40% + 30px) !important;
  }
}

@media (max-width: 768px) {
  #chatAIModal {
    width: 100%;
    right: -100%;
    top: 0;
    z-index: 1060;
  }
  
  body:has(#chatAIModal.show) .content {
    padding-right: 30px !important;
  }
  
  .chat-component {
    height: 100vh;
  }
  
  .chat-header {
    padding: 0.75rem 1rem;
  }
  
  .chat-title-logo {
    height: 24px !important;
  }
  
  .chat-body {
    padding: 1rem 0.5rem;
    padding-bottom: 160px;
  }
  
  .info-title {
    font-size: 1.25rem;
  }
  
  .chat-panel-close-btn {
    top: 10px;
    right: 10px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  #chatAIModal {
    width: 100%;
    right: -100%;
    top: 0;
  }

  body:has(#chatAIModal.show) .content {
    padding-right: 15px !important;
  }
  
  .chat-component {
    height: 100vh;
  }
  
  .chat-header {
    padding: 0.5rem 0.75rem;
  }
  
  .chat-title-logo {
    height: 20px !important;
  }
  
  .chat-body {
    padding: 0.75rem 0.5rem;
    padding-bottom: 200px;
  }
  
  .info-title {
    font-size: 1rem;
  }
  
  .info-component {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .chat-input {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .chat-panel-close-btn {
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    padding: 3px;
  }
}

.chat-mode, 
.documents-mode {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.chat-mode[style*="display: block"],
.documents-mode[style*="display: block"] {
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
}

.chat-mode[style*="display: block"] .chat-body,
.documents-mode[style*="display: block"] .documents-body {
  flex: 1 !important;
  min-height: 0 !important;
}

.documents-mode {
  max-height: 100%;
  overflow: hidden;
}

.documents-header {
  flex-shrink: 0 !important;
}

.documents-body {
  flex: 1 !important;
  overflow-y: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
}

#documentsContainer {
  flex: 1 !important;
  overflow-y: auto !important;
  min-height: 0;
}

.document-item {
  cursor: pointer;
  transition: background-color 0.2s;
}

.document-item:hover {
  background-color: #f8f9fa;
}

.document-item input[type="checkbox"]:checked + label {
  font-weight: 500;
  color: #0066cc;
}

#documentSearch {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
}

#documentSearch:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.info-component.selected {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.documents-mode .send-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

#chatAIModal .btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#chatAIModal .btn-primary {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

#chatAIModal .btn-primary:hover {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
}

#chatAIModal .btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

#chatAIModal .btn-secondary:hover {
  color: #fff;
  background-color: #5a6268;
  border-color: #545b62;
}

#chatAIModal .btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
}

#chatAIModal .btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

#chatAIModal .btn-outline-secondary.active {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

#chatAIModal .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

.form-control {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check {
  position: relative;
  display: block;
  padding-left: 1.25rem;
}

.form-check-input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.25rem;
}

.form-check-label {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: #6c757d;
}

.text-danger {
  color: #dc3545;
  font-size: 1rem;
  font-family: Roboto;
}

.text-muted {
  font-size: 1rem;
  font-family: Roboto;
}

.p-3 {
  padding: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.border {
  border: 1px solid #dee2e6;
}

.rounded {
  border-radius: 0.25rem;
}

.chat-component {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 0 0;
    align-self: stretch;
    height: calc(100vh - 164px);
    max-width: 100%;
    border: none;
    border-radius: 0;
}

#chatAIModal.scrolled .chat-component {
    height: calc(100vh - 72px);
}

.chat-header {
    display: flex;
    padding: 1.5rem 2rem;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
    border-radius: 0.125rem 0.125rem 0rem 0rem;
    border: 1px solid var(--Universal-Tokens-Outline, #EDE9E9);
    background: #2196F3;
    flex-shrink: 0;
}

.chat-title {
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: normal;
}

.chat-title-logo {
    height: 32px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.chat-body {
    display: flex;
    padding: 1.5rem 1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    gap: 23px;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #FFFFFF;
    flex: 1;
    min-height: 0;
    height: calc(100% - 200px);
    max-height: calc(100% - 200px);
}

#chatAIModal.scrolled .chat-body {
    height: calc(100vh - 272px);
    max-height: calc(100vh - 272px);
}

.chat-body.has-messages {
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
}

.chat-body, .info-title {
    color: #000;
    font-family: Roboto;
    font-size: 1.5rem;
    font-style: bold;
    font-weight: 400;
    line-height: normal;
}

.chat-body .info-options {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.info-component {
    display: flex;
    padding: 0.5rem 1rem;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    border: 1px solid #DADCE0;
    background: #FFFFFF;
    color: #3C4043;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, border 0.3s;
}

.info-component.selected {
    background: #D1E8FF;
    border-color: #3B82F6;
}

.info-component.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-component-title {
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.chat-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-info {
    display: flex;
    padding: 0.75rem;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    align-self: stretch;
    border-radius: 0.125rem 0.125rem 0rem 0rem;
    border: 1px solid var(--Universal-Tokens-Outline, #EDE9E9);
    background: var(--Universal-Tokens-Element-Secondary, #FDFDFD);
    flex-shrink: 0;
    margin-top: auto;
    position: absolute;
    bottom: 0px;
    width: 100%;
}

.data-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-input {
    display: flex;
    padding: 0.75rem;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    height: 40px !important;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    align-self: stretch;
    border-radius: 0.5rem;
    border: 1px solid var(--Contorno, #dee2e6);
    background: var(--Universal-Tokens-Element-Secondary, #FDFDFD);
}

.chat-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    align-items: flex-end;
    gap: 0.75rem;
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    border-radius: 1.25rem 0rem 1.25rem 1.25rem;
    border: 1px solid var(--Universal-Tokens-Outline, #EDE9E9);
    background: var(--Universal-Tokens-Background-Screen, #F3F3F3);
    padding: 0.75rem;
    margin: 0.5rem 0;
    max-width: 80%;
    align-self: flex-end;
    word-wrap: anywhere;
}

.docs-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-end;
    font-size: 0.75rem;
    color: #6c757d;
    margin: -1rem 0.25rem 1rem;
    padding: 2px 6px;
}

.docs-count-chip i.zmdi {
    font-size: 0.875rem;
    line-height: 1;
}

.receive-message-exterior {
    justify-items: flex-start;
    width: 100%;
}

.receive-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    background: #FFF;
    padding: 0.75rem;
    margin: 0.5rem 0;
    max-width: 100%;
    align-self: flex-start;
    word-wrap: anywhere;
}

.receive-message-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    background: #FFF;
    padding: 0.75rem;
    margin: 0.5rem 0;
    max-width: 100%;
    align-self: flex-start;
    word-wrap: anywhere;
}

.btn-chat {
    border: none;
    background: var(--Universal-Tokens-Fill-Element-Primary, #FAFAFA);
    cursor: pointer;
}

.btn-chat .zmdi-copy {
    vertical-align: middle;
    margin-top: -45px;
}

.send-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.send-container .chat-input {
    flex: 1;
}

.send-container .send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #2196f3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-container .send-button:hover {
    background: #1976d2;
}

.send-container .send-button i {
    color: white;
    font-size: 1.25rem;
}

.card-chat {
    display: flex;
    justify-content: space-between;
}

.ai-icon {
    display: flex;
    width: 2rem;
    height: 2rem;
    padding: 0.375rem;
    justify-content: center;
    align-items: center;
    border-radius: 2.56rem;
    background-color: #0044E2;
}

.ai-title {
    color: var(--Universal-Tokens-Element-Primary, #202124);
    font-family: Roboto;
    font-size: 1.125rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.card-ai {
    display: flex; 
    flex-direction: row; 
    min-width: 100%;
    flex-wrap: nowrap;
}

.card-header-ai {
    display: flex; 
    justify-content: space-between; 
    width: 100%;
}

@media screen and (max-width: 768px) {
    .responsiviness {
        flex-wrap: wrap;
        flex-direction: row;
        width: 100%;
    }

    .card-ai {
        flex-wrap: wrap;
    }
}

@media screen and (min-width: 481px) {
    .responsiviness {
        max-width: 100%;
    }
}

.shine-text {
    font-size: 1rem;
    font-weight: normal;
    background: linear-gradient(to right, #000 0%, #fff 50%, #fff 100%) 0 0 no-repeat;
    background-size: 150px;
    color: #000000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s infinite;
    text-shadow: 0 0px 0px rgba(0, 0, 0, 0.5);
}

@keyframes shine {
    0% {
        background-position: -700px;
    }
    100% {
        background-position: 700px;
    }
}

@-webkit-keyframes shine {
    0% {
        background-position: -700px;
    }
    100% {
        background-position: 700px;
    }
}

.svg-icon {
    fill: black;
}

.svg-icon.filled {
    fill: #0044E2;
}

.svg-blue-ball {
    background: #0044E2;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.markdown-content .h1,
.markdown-content h1 {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #0044e2;
  line-height: 1.2;
  letter-spacing: 0;
}

.markdown-content .h2,
.markdown-content h2 {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #0044e2;
  line-height: 1.25;
  letter-spacing: 0;
}

.markdown-content .h3,
.markdown-content h3 {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #0044e2;
  line-height: 1.25;
  letter-spacing: 0;
}

.markdown-content .h4,
.markdown-content h4 {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #0044e2;
  line-height: 1.3;
  letter-spacing: 0;
}

.markdown-content .body,
.markdown-content p {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: #313235;
  line-height: 1.5;
  letter-spacing: 0;
}

.markdown-content .body--bold,
.markdown-content strong {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #313235;
  line-height: 1.5;
}

.markdown-content .small,
.markdown-content small {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #6B6C6F;
  line-height: 1.4;
  letter-spacing: 0;
}

.markdown-content code {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 14px;
  background: #f8f9fa;
  color: #1f2937;
  border-radius: 6px;
  padding: 2px 4px;
}

.markdown-content pre code {
  display: block;
  padding: 12px;
  background: #f3f4f6;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.4;
}

.markdown-content ul,
.markdown-content ol {
  font-family: "Noto Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: #313235;
  margin-left: 20px;
  line-height: 1.5;
}

.markdown-content a {
  color: #0044e2;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.markdown-content a:hover {
  color: #002b9a;
}

.markdown-content blockquote {
  border-left: 4px solid #0044e2;
  padding-left: 12px;
  margin: 12px 0;
  color: #555;
  font-style: italic;
  background: #f9f9ff;
}

.chat-scroll-indicator {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: rgba(0, 68, 226, 0.8);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 1060;
}

.chat-scroll-indicator:hover {
  background: rgba(0, 68, 226, 1);
}

.chat-scroll-indicator.visible {
  display: flex;
}

@media (max-width: 768px) {
  .chat-scroll-indicator {
    display: flex;
  }
}

.corina-ai-container {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.corina-ai-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  animation: 
    2s linear 0s 3 normal forwards running Background,
    0.3s ease-out 6s 1 normal forwards running FadeOut;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  z-index: 1;
}

.corina-ai-background.animation-stopped {
  animation: none;
  opacity: 0;
  visibility: hidden;
}



@keyframes Background {
  0% {
    transform: rotate(0deg);
    background-position: 0% 50%;
  }
  50% {
    transform: rotate(-360deg);
    background-position: 100% 50%;
  }
  100% {
    transform: rotate(-720deg);
    background-position: 0% 50%;
  }
}

@keyframes FadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

.corina-ai-icon {
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease, filter 0.2s ease;
  pointer-events: none;
}

.corina-ai-container:hover .corina-ai-icon {
  transform: scale(1.1);
  filter: brightness(1.2);
}

a#toggleChatAIModal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s ease, border-radius 0.2s ease;
}

a#toggleChatAIModal:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

a#toggleChatAIModal.active {
  border-radius: 4px;
  background: #2196F3;
}

.attachment-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.attachment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #495057;
  position: relative;
}

.attachment-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.attachment-btn.active {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #2196f3;
}

.attachment-btn.has-selection {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #2196f3;
}

.attachment-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  background: #2196f3;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.attachment-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1100;
  min-width: 220px;
  display: none;
  overflow: visible;
}

.attachment-popover.show {
  display: block;
  animation: popoverFadeIn 0.2s ease;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 500;
  font-size: 0.875rem;
  color: #495057;
}

.popover-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.popover-close-btn:hover {
  color: #212529;
}

.popover-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.popover-body .info-component {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.popover-body .info-component:hover {
  background: #f8f9fa;
}

.popover-body .info-component.selected {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #2196f3;
}

.popover-body .info-component.selected svg path {
  fill: #2196f3;
}

.popover-body .external-docs-trigger {
  justify-content: space-between;
}

.popover-body .external-docs-trigger .external-arrow {
  transition: transform 0.2s ease;
}

.popover-body .external-docs-trigger:hover .external-arrow {
  transform: translateX(2px);
}

/* External Docs Subpanel */
.external-docs-subpanel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: none;
  max-height: 400px;
  overflow: hidden;
  z-index: 1101;
}

.external-docs-subpanel.show {
  display: flex;
  flex-direction: column;
  animation: subpanelSlideIn 0.2s ease;
}

@keyframes subpanelSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subpanel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 500;
  font-size: 0.875rem;
  color: #495057;
}

.subpanel-back-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.subpanel-back-btn:hover {
  background: #e9ecef;
  color: #212529;
}

.subpanel-body {
  padding: 12px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popover-documents-container {
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  min-height: 100px;
}

.popover-documents-container .document-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.popover-documents-container .form-check-label {
  font-size: 0.8rem;
  margin-left: 16px;
}

.subpanel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}

.subpanel-footer .btn {
  font-size: 0.8rem;
  padding: 6px 12px;
}

@media (max-width: 768px) {
  .attachment-popover {
    min-width: 200px;
  }
  
  .external-docs-subpanel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: auto;
    top: auto;
    width: auto;
    margin-left: 0;
    margin-top: 8px;
  }
  
  .attachment-popover.show .external-docs-subpanel.show {
    position: relative;
    left: 0;
    margin-left: 0;
    margin-top: 0;
    border-top: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Upload file styles */
.upload-file-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0f7ff;
  border-radius: 8px;
  border: 1px solid #2196f3;
}

.uploaded-file-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #1976d2;
}

.uploaded-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.remove-file-btn {
  background: none;
  border: none;
  color: #d32f2f;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.remove-file-btn:hover {
  color: #b71c1c;
}

.upload-error-message {
  margin-top: 8px;
  padding: 8px 12px;
  background: #ffebee;
  border-radius: 8px;
  border: 1px solid #ef5350;
  font-size: 0.75rem;
  color: #c62828;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-error-message svg {
  flex-shrink: 0;
}

/* Upload file preview (outside popover) */
.uploaded-file-preview {
  display: flex;
  justify-content: flex-start;
  padding: 8px 16px;
  background: #f5f9ff;
  border-bottom: 1px solid #e3f2fd;
}

.uploaded-file-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 16px;
  font-size: 0.8rem;
  color: #1565c0;
}

.uploaded-file-preview-badge svg {
  flex-shrink: 0;
  color: #1976d2;
}

.uploaded-file-preview-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file-preview-btn {
  background: none;
  border: none;
  color: #c62828;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
  margin-left: 4px;
}

.remove-file-preview-btn:hover {
  color: #b71c1c;
}
.document-template-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff3e0;
  border-radius: 8px;
  border: 1px solid #ffb74d;
}

.document-template-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #e65100;
}

.document-template-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.remove-template-btn {
  background: none;
  border: none;
  color: #d32f2f;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.remove-template-btn:hover {
  color: #b71c1c;
}

.document-template-preview {
  display: flex;
  justify-content: flex-start;
  padding: 8px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
}

.document-template-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 16px;
  font-size: 0.8rem;
  color: #e65100;
}

.document-template-preview-badge svg {
  flex-shrink: 0;
  color: #f57c00;
}

.document-template-preview-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-template-preview-btn {
  background: none;
  border: none;
  color: #c62828;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s;
  margin-left: 4px;
}

.remove-template-preview-btn:hover {
  color: #b71c1c;
}

.popover-body .info-component[data-type="document-template"].selected {
  background: #fff3e0;
  border-color: #f57c00;
  color: #e65100;
}

.popover-body .info-component[data-type="document-template"].selected svg {
  stroke: #f57c00;
}

.popover-body .info-component[data-type="document-template"]:hover {
  background: #fff8e1;
}
