:root {
  --brand: #16163e;
  --bg: #16163e;
  --bubble: #ffffff;
  --bot: #eef1ff;
  --accent: #ff9d0a;
  --ok: #2e7d32;
  --danger: #c62828;
  --hover: #ff9d0a;
  /* amarelo */
}

/* reset box-sizing */
* {
  box-sizing: border-box;

}

/* app geral */
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    Helvetica, sans-serif;
  background: var(--bg);
  color: #222;
  height: 100vh;
  overflow: hidden;
}

/* header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 40px;
  z-index: 9999;
}


.app-controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  z-index: 10;
}

#user-menu-container {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}


.app-controls .tab-btn {
  border: none;
  background: #e9ecff;
  color: #1a2258;
  padding: 8px 14px;
  margin-left: 8px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.app-controls .tab-btn.active {
  background: #ff9d0a;
  color: #fff;
}

/* chat wrapper / phone frame */
.chat-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0 24px 0;
}

.phone-frame {
  width: 480px;
  padding: 8px;
  background: white;
  border-radius: 34px;
}

.chat-container {
  width: 100%;
  height: 120%;
  background: var(--phone-bg);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}



/* main layout */
.app-main {
  padding: 1%;
}

.panel {
  display: none;
}

.panel.visible {
  display: block;
}

/* chat container */
.chat-container {
  height: 72vh;
  min-height: 520px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.chat-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  background: #16163e;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-title {
  font-weight: bold;
  color: #fff;
}

/* chat box */
.chat-box {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 10px 14px;
  background: linear-gradient(#f8f9ff, #fff);
}

.msg-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.msg-row.bot .msg-avatar {
  margin-right: 8px;
}

.msg-row .msg-spacer {
  width: 42px;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 34px;
}

.msg-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble-wrap {
  max-width: 82%;
  align-items: center;
}

.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  color: var(--text-white);
  box-shadow: 0 1px 1px #584a34;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.bot-msg {
  background: linear-gradient(180deg,
      var(--bubble-bot),
      var(--bubble-bot-accent));
  color: #222;
  border-bottom-left-radius: 6px;
}

.user-msg {
  background: var(--bubble);
  border: 1px solid #eee;
}

.msg-time {
  font-size: 11px;
  color: #667;
  margin-top: 4px;
  margin-left: 6px;
}

/* input area */
.input-area {
  border-top: 1px solid #efefef;
  background: #fff;
  padding: 8px;
}

.type-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.left-icons {
  display: flex;
  gap: 6px;
}

.icon-small {
  border: none;
  background: #f4f4ff;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}

.icon-small:hover {
  background: var(--hover);
  color: #fff;
}

.type-wrapper input {
  flex: auto;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
}

.send-btn {
  border: none;
  background: #ff9d0a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.send-btn:hover {
  filter: brightness(1.06);
}

.msg-row.user {
  justify-content: flex-end;
  gap: 10px;
  align-items: flex-end;
  text-align: right;
}

/* buttons/options */
.options-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-btn {
  border: none;
  background: #e9ecff;
  color: #26581a;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

.option-btn:hover {
  background: var(--hover);
  color: #fff;
}

.option-btn.success {
  background: #e7f5ea;
  color: #1b5e20;
}

.option-btn.success:hover {
  background: var(--ok);
  color: #fff;
}

.option-btn.danger {
  background: #fdeaea;
  color: #8b1b1b;
}

.option-btn.danger:hover {
  background: var(--danger);
  color: #fff;
}

/* board */
.board-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: space-between;
}

.small-btn {
  border: none;
  background: #ff9d0a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: auto;
  width: 160px;
}

.small-btn-not {
  border: none;
  background: #ff9d0a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: auto;

}

.small-btn-user {
  border: none;
  background: #ff9d0a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: auto;

}





.small-btn-sidebar {
  border: none;
  background: #ff9d0a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  height: auto;
  width: 100%;
}



.small-btn:hover {
  background: var(--hover);
  color: #fff;
}

.board-empty {
  display: none;
  padding: 20px;
  border: 1px dashed #ddd;
  background: #fff;
  color: #666;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 10px;
}

/* board columns */
.board-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  height: 750px;
}

.column {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.col-header {
  padding: 10px;
  font-weight: 700;
  border-bottom: 1px solid rgba(11, 20, 30, 0.04);
  background: #ff9d0a;
  color: white;
  border-radius: 10px;
  align-items: center;
}

.col-header-usur {
  background: #292972 !important;
}

.col-list {
  padding: 6px;
  border-radius: 12px;
  margin-top: 8px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.col-list.over {
  border-color: #d2d6ff;
  background: #fafbff;
}

.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: none;
  display: flex;
  flex-direction: column;
  height: 120px;
  overflow: auto;
  -webkit-user-drag: element;
  position: relative;
  padding-top: 8px;
  /* Espaço para a barra */
}


.btn-toggle-sidebar {
  background: #ff9d0a;
  color: #fff;
}

.card:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-weight: 700;
  color: #1a2258;
  margin-bottom: 10px;
  margin-top: 10px;
}

.card-body {
  font-size: 14px;
  color: #333;
  white-space: pre-wrap;
}

.card-meta {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

.card-total-days-bottom {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #16163e;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.card-owner-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(255, 255, 255, 0.85);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #16163e;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.urgent-ico {
  color: #c62828;
  margin-left: 6px;
  font-weight: bold;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: 850px;
  max-height: 80vh;
  /* More restrictive to ensure it fits below header */
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.modal-content-not {
  position: relative;
  width: 400px;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  top: -150px;
}

/* Fix for User Management Modal to prevent jumping */
#usuarios-mgmt-modal {
  align-items: flex-start;
  padding-top: 80px;
}

#usuarios-mgmt-modal .modal-content {
  height: 600px;
  /* Fixed height */
  max-height: 85vh;
}

#usuarios-list-container {
  height: 450px;
  /* Fixed container height */
  max-height: 450px !important;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: #1a2258;
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--hover);
  color: #fff;
}

.meta-wrap {
  margin-bottom: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f2f2f2;
}

.detail-key {
  font-weight: 700;
  color: #1a2258;
}

.detail-val {
  color: #333;
  word-break: break-word;
}

.attach-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.attach-link {
  text-decoration: none;
  color: #1a2258;
}

.attach-link:hover {
  text-decoration: underline;
}

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

.comment-line {
  font-size: 14px;
  color: #222;
}

.comment-form {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  width: 540px;
}

.comment-form textarea {
  flex: 1;
  min-height: 50px;
  resize: vertical;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px;
  width: 20px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    Helvetica, sans-serif;
}

.muted {
  color: #6b6b6b;
  font-size: 13px;
}

/* KB / Grid / Chat styles (from your snippet) */
.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: #2c3e50;
  color: white;
  padding: 20px;
}

.sidebar h2 {
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin: 15px 0;
}

.sidebar a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.sidebar a:hover {
  color: #3498db;
}

.content {
  flex: 1;
  padding: 30px;
  background-color: white;
}

#form-pesquisa {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}

input[type="text"],
input[type="date"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}


.resultado-item {
  border: 1px solid #ddd;
  padding: 15px;
  margin: 10px 0;
  border-radius: 4px;
  cursor: pointer;
}

.resultado-item:hover {
  background-color: #f9f9f9;
}

.filtros {
  border: 1px solid #ddd;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.filtro-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.filtro-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.filtro-group.full-width {
  flex: 2;
}

.filtro-group label {
  margin-bottom: 5px;
  font-weight: 500;
}

.rankings {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.ranking-box {
  flex: 1;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 4px;
  background: white;
}

.ranking-box h4 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.ranking-box ul {
  list-style: none;
}

.ranking-box li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

#tabela-registros {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
}

#tabela-registros th,
#tabela-registros td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

#tabela-registros th {
  background-color: #f2f2f2;
  font-weight: bold;
  border-radius: 0px;
}

#tabela-registros tr:hover {
  background-color: #f2f2f2;
  border-radius: 0px;
}

.error {
  color: #d32f2f;
  background-color: #ffebee;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  border-left: 4px solid #d32f2f;
}

.info {
  color: #1976d2;
  background-color: #e3f2fd;
  padding: 10px;
  border-radius: 4px;
  margin: 10px 0;
  border-left: 4px solid #1976d2;
}

/* Modal (KB) overrides */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Chat KB */
.chat-container {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 15px;
  background-color: #f9f9f9;
}

.message {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  max-width: 80%;
}

.message.user {
  background-color: #3498db;
  color: white;
  margin-left: auto;
}

.message.bot {
  background-color: #e9ecef;
  color: #333;
}

.message p {
  margin: 0;
}

.chat-input {
  display: flex;
  padding: 10px;
  background-color: white;
  border-top: 1px solid #ddd;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-right: 10px;
}

/* responsive */
@media (max-width: 900px) {
  .phone-frame {
    width: 95%;
  }

  .board-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* GRID - sem highlight ao passar o mouse */

/* Container da busca da Base de Conhecimento */
.kb-search-container {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Campo de busca igual ao chat */
.kb-search-container input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  outline: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.kb-search-container input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Botões de ação iguais ao chat */
.kb-search-container .btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-right: 8px;
  cursor: pointer;
  /*transition: background 0.2s ease;*/
}

.kb-search-container .btn-primary {
  background: #ff9d0a;
  border: none;
  color: #fff;
}

.kb-search-container .btn-primary:hover {
  background: #ff9d0a;
}

.kb-search-container .btn-secondary {
  background: #6c757d;
  border: none;
  color: #fff;
}

.kb-search-container .btn-secondary:hover {
  background: #565e64;
}

/* Resultados da busca */
#resultados-pesquisa {
  margin-top: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 10px;
  max-height: 400px;
  overflow-y: auto;
}

/* ===== Detalhes expansível (resumo + extras) ===== */
.detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 10px;
  background: #fbfbfb;
  border: 1px solid #eee;
  margin-top: 30px;
}

.detail-summary .summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  align-items: center;
  width: 100%;
}

.detail-summary .summary-grid .s-key {
  font-weight: 700;
  color: #1a2258;
  font-size: 13px;
}

.detail-summary .summary-grid .s-val {
  font-size: 13px;
  color: #333;
}

/* toggle button (arrow) */
.toggle-detail-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: transform 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-detail-btn .arrow {
  display: inline-block;
  transition: transform 200ms ease;
  font-size: 18px;
  color: #1a2258;
}

.toggle-detail-btn[aria-expanded="true"] .arrow {
  transform: rotate(180deg);
}

/* extra details (collapsible) */
.detail-extra {
  overflow: hidden;
  transition: max-height 260ms ease, opacity 200ms ease;
  max-height: 0;
  opacity: 0;
}

.detail-extra.expanded {
  max-height: 1600px;
  /* suficientemente grande */
  opacity: 1;
}

/* manter aparência das linhas igual ao resto */
.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f6f6f6;
}

.detail-row .detail-key {
  font-weight: 700;
  color: #1a2258;
  font-size: 13px;
}

.detail-row .detail-val {
  color: #333;
  font-size: 13px;
  word-break: break-word;
}

/* Attach box / comments keep same styles as existing, but ensure spacing */
.attach-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Botões de ação (espaçamento extra) */
.action-buttons {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-direction: row;
  flex-wrap: nowrap;
}

.action-buttons .small-btn {
  padding: 8px 12px;
  height: 34px;
  border-radius: 8px;
}

/* Visual tweak: texto minimizado para campos extras */
.detail-extra .muted-min {
  font-size: 13px;
  color: #666;
}

/* Responsividade */
@media (max-width: 720px) {
  .detail-summary .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Detalhes expansível (resumo + extras) ===== */
.detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 10px;
  background: #fbfbfb;
  border: 1px solid #eee;
}

.detail-summary .summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  align-items: center;
  width: 100%;
}

.detail-summary .summary-grid .s-key {
  font-weight: 700;
  color: #1a2258;
  font-size: 13px;
}

.detail-summary .summary-grid .s-val {
  font-size: 13px;
  color: #333;
}

/* toggle button (plus / minus) */
.toggle-detail-btn {
  border: none;
  background: #e9ecff;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 18px;
  color: #1a2258;
  width: 42px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-detail-btn:hover {
  background: #ff9d0a;
  color: #fff;
}

/* extra details (collapsible) */
.detail-extra {
  overflow: hidden;
  transition: max-height 260ms ease, opacity 200ms ease;
  max-height: 0;
  opacity: 0;
}

.detail-extra.expanded {
  max-height: 1600px;
  /* suficientemente grande */
  opacity: 1;
}

/* manter aparência das linhas igual ao resto */
.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f6f6f6;
}

.detail-row .detail-key {
  font-weight: 700;
  color: #1a2258;
  font-size: 13px;
}

.detail-row .detail-val {
  color: #333;
  font-size: 13px;
  word-break: break-word;
}

/* Comments collapsible */
.comments-wrapper {
  margin-top: 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.comments-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
  background: #fafafa;
  border-bottom: 1px solid #f1f1f1;
}

.comments-summary .cs-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.comments-summary .cs-title {
  font-weight: 700;
  color: #1a2258;
}

.comments-summary .cs-info {
  color: #666;
  font-size: 13px;
}

.comments-area {
  max-height: 0;
  transition: max-height 260ms ease, opacity 200ms ease;
  opacity: 0;
  overflow: auto;
  padding: 0 12px;
}

.comments-area.open {
  max-height: 420px;
  padding: 12px;
  opacity: 1;
}

/* TI comments button (popup) and action button spacing */
.action-buttons {
  display: flex;
  gap: 12px;
  /* mais espaço entre botões */
  margin-top: 12px;
  flex-wrap: wrap;
}

.action-buttons .small-btn {
  padding: 8px 12px;
  height: 34px;
  border-radius: 8px;
}

/* comment line */
.comment-line {
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
}

.comment-line small {
  color: #777;
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

/* forms */
.comment-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form textarea {
  min-height: 70px;
  width: 570px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
}

.comment-form .btn-row {
  display: flex;
  gap: 8px;
  justify-content: start;
}

/* ...existing code... */
#alert-modal .modal-content {
  min-width: 240px;
  max-width: 340px;
  padding: 24px 18px;
}

#alert-modal .modal-content-not {
  min-width: 240px;
  max-width: 340px;
  padding: 24px 18px;
}

#alert-modal .small-btn {
  min-width: 80px;
}

/* comments-only modal tweaks */
.modal-content.small {
  max-width: 620px;
  width: 92vw;
  max-height: 80vh;
  padding: 12px;
}

.modal-content-not.small {
  max-width: 620px;
  width: 92vw;
  max-height: 80vh;
  padding: 12px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 6px;
}

.comment-line {
  padding: 8px;
  border-bottom: 1px solid #f2f2f2;
}

.comment-line small {
  color: #666;
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.comment-form textarea {
  min-height: 70px;
  resize: vertical;
  border-radius: 8px;
  padding: 8px;
  border: 1px solid #eee;
}

/* Comments popup */
.comments-overlay {
  position: fixed;
  inset: 0;
  /* top:0;right:0;bottom:0;left:0 */
  display: none;
  /* escondido por padrão */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1200;
  padding: 18px;
}

.comments-overlay.open {
  display: flex;
}

.comments-modal {
  width: 640px;
  max-width: calc(100% - 36px);
  max-height: 80vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comments-close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.comments-container {
  overflow: auto;
  padding-right: 6px;
  flex: 1 1 auto;
}

/* lista de comentários */
.comment-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
}

.comment-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.comment-text {
  white-space: pre-wrap;
}

/* formulário simples */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.comment-form textarea {
  min-height: 70px;
  resize: vertical;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.comment-form .btn {
  align-self: flex-end;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: #1976d2;
  color: #fff;
}

.comments-loader {
  padding: 12px;
  color: #666;
}

.muted {
  color: #999;
  padding: 8px;
}

/* --- modal comentários internos (estilos simples) --- */
#comments-modal .modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

#comments-modal .modal-content-not {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.comments-body {
  max-height: 360px;
  overflow: auto;
  padding: 8px 4px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 8px 0;
}

.comment-item {
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
}

.comment-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.comment-text {
  white-space: pre-wrap;
  font-size: 14px;
  color: #222;
}

/* footer */
#comments-footer {
  margin-top: 10px;
}

#internal-comment-text {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  resize: vertical;
}

/* badge no botão abrir comentários */
.internal-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 50%;
  font-size: 11px;
  text-align: center;
  background: #e53935;
  color: #fff;
  margin-left: 8px;
  padding: 0 5px;
  vertical-align: middle;
}

/* pequeno destaque visual para cards marcados como projeto (opcional) */
.card.card-projeto {
  border-left: 4px solid #1565c0;
}

/* Painel de comentários no detalhe do chamado (scroll) */
.details-comments {
  max-height: 360px;
  /* ajustar conforme o layout */
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* Itens de comentário */
.details-comments .comment-item {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #f2f2f2;
}

.details-comments .comment-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.details-comments .comment-text {
  white-space: pre-wrap;
  font-size: 14px;
  color: #222;
}

/* botão comentários internos no painel de detalhe (aparece só para admin) */
#btn-open-internal-detail {
  display: none;
  margin-top: 8px;
}

/* badge de internos (pequeno círculo com número) */
.internal-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 50%;
  font-size: 11px;
  text-align: center;
  background: #e53935;
  color: #fff;
  margin-left: 8px;
  padding: 0 5px;
  vertical-align: middle;
}


/* painel de comentários com scroll aproximado para ~8 linhas */
.comments-scroll {
  box-sizing: border-box;
  width: 100%;
  height: 12.0em;
  /* ~8 linhas — ajuste se necessário */
  max-height: 12.0em;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e9e9e9;
  border-radius: 6px;
  background: #fff;
  margin-top: 8px;
}

/* cada comentário no painel */
.comments-scroll .comment-item {
  padding: 8px 6px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #fbfbfb;
  border: 1px solid #f0f0f0;
}

.comments-scroll .comment-meta {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: #222;
}

.comments-scroll .comment-text {
  white-space: pre-wrap;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

/* badge interno */
.internal-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 50%;
  font-size: 11px;
  text-align: center;
  background: #e53935;
  color: #fff;
  margin-left: 8px;
  padding: 0 5px;
  vertical-align: middle;
}

/* pequenas variações para modais small / large (se já tem no seu CSS, ignore) */
.modal .modal-content.small {
  max-width: 720px;
  width: 100%;
}

.modal .modal-content.large {
  max-width: 1100px;
  width: 100%;
}

.modal .modal-content-not.large {
  max-width: 1100px;
  width: 100%;
}

.pencil-ico {
  font-size: 14px;
  margin-left: 4px;
  opacity: .8
}

.table-wrap {
  max-height: 420px;
  overflow: auto
}

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

.table th,
.table td {
  border: 1px solid #e7e7e7;
  padding: 8px;
  text-align: left
}


/* Comentários - estilo de balões */
.comments-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* container de cada comentário */
.comment-item {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  word-wrap: break-word;
  line-height: 1.35;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* público: bolha à esquerda */
.bubble-left {
  margin-left: 0;
  margin-right: auto;
  background: #f1f3f5;
  color: #111;
  border-top-left-radius: 4px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 12px;
}

/* interno: bolha à direita */
.bubble-right {
  margin-left: auto;
  margin-right: 0;
  background: #fff7e6;
  color: #111;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 12px;
}

/* meta (autor + timestamp) */
.comment-meta {
  font-size: 12px;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* texto do comentário */
.comment-text {
  white-space: pre-wrap;
  color: #222;
  font-size: 14px;
}

/* botão de opções (pequeno) posicionado no canto do balão */
.comment-options-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.comment-options-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* container do formulário (textarea + botoes) */
.comments-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* botões no form (padrão visual) */
.comments-form-wrap .small-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.comments-form-wrap .small-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* responsividade: reduzir largura dos balões em telas pequenas */
@media (max-width:720px) {
  .comment-item {
    max-width: 92%;
  }
}

/* Comentários - estilo de bolhas e menu */
.comments-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  word-wrap: break-word;
  line-height: 1.35;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 6px;
}

/* público: bolha à esquerda */
.bubble-left {
  margin-left: 0;
  margin-right: auto;
  background: #f1f3f5;
  color: #111;
}

/* interno: bolha à direita */
.bubble-right {
  margin-left: auto;
  margin-right: 0;
  background: #fff7e6;
  color: #111;
}

/* meta (autor + timestamp) */
.comment-meta {
  font-size: 12px;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* timestamp pequeno ao lado direito (quando caber) */
.comment-timestamp {
  margin-left: auto;
  color: #666;
  font-size: 11px;
}

/* texto do comentário */
.comment-text {
  white-space: pre-wrap;
  color: #222;
  font-size: 14px;
}

/* botão de opções (pequeno) posicionado no canto do balão */
.comment-options-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.comment-options-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* menu dropdown simples */
.comment-options-menu {
  position: absolute;
  top: 30px;
  right: 8px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 6px;
  z-index: 9999;
  display: none;
  min-width: 120px;
}

/* botão excluir no menu */
.comment-options-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
}

.comment-options-menu button:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* form */
.comments-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width:720px) {
  .comment-item {
    max-width: 92%;
  }
}

.project-ico {
  display: inline-block;
  margin-left: 6px;
  font-size: 14px;
  vertical-align: middle;
  animation: none !important;
}

.refresh-ico {
  display: inline-block;
  margin-left: 6px;
  font-size: 14px;
  vertical-align: middle;
  animation: none !important;
  transition: none !important;
}

/* === Sidebar de filtros === */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(1px);
  z-index: 950;
}

.sidebar-overlay.hidden {
  display: none;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100vh;
  background: var(--app-bg, #fff);
  color: var(--brand, #16163e);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .15);
  z-index: 960;
  display: flex;
  flex-direction: column;
  transition: right .25s ease;
  border-left: 2px solid rgba(0, 0, 0, .06);
}

.sidebar.open {
  right: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.sidebar-body {
  padding: 12px 16px;
  overflow: auto;
  flex: 1;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, .08);
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.sidebar .field {
  margin-bottom: 12px;
}

.sidebar .field.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar .field.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.sidebar input[type="text"],
.sidebar input[type="date"],
.sidebar select,
.sidebar input[type="email"] {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 10px;
  padding: 10px;
  outline: none;
}

.sidebar .chk {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.pill input {
  margin: 0;
}

.small-btn.warn {
  background: #ff9d0a;
  color: #16163e;
}

.small-btn.primary {
  background: var(--accent, #ffa900);
}

.small-btn.ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, .2);
  color: var(--brand, #16163e);
}

/* Users modal */
.modal .modal-content.large {
  width: min(820px, 92vw);
}

.modal .modal-content-not.large {
  width: min(820px, 92vw);
}

.user-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.user-list {
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 12px;
  padding: 6px;
  max-height: 300px;
  overflow: auto;
  background: #fafafa;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-bottom: 1px dashed rgba(0, 0, 0, .1);
}

.user-row:last-child {
  border-bottom: none;
}

.user-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, .08);
}

.user-row .edit-btn {
  padding: 6px 10px;
}

/* === Rail de status === */
.card {
  position: relative;
}

.card .status-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  border-right: 1px solid rgba(0, 0, 0, .06);
}

.card .status-rail .seg {
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.card .status-rail .seg:last-child {
  border-bottom: none;
}

.seg-off {
  background: #eeeded;
}

.seg-done {
  background: #2e7d32;
}

.seg-warn {
  background: #f9a825;
}

.seg-late {
  background: #c62828;
}

.seg-reset {
  background: #111;
}

/* Sidebar (left) */
.sidebar.left {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 300px;
  background: #0f1222;
  color: #f0f3fa;
  border-right: 1px solid #2a2e46;
  transform: translateX(-100%);
  transition: transform .2s ease;
  z-index: 900;
  padding: 12px;
}

.sidebar.left.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  margin-top: 80px;

}

.sidebar-content .field {
  margin: 10px 0;
}

.sidebar-content .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-content .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: #1a1f35;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

#sb-my {
  transform: translateY(1px);
}

body.sidebar-open .board-wrapper {
  margin-left: 300px;
  transition: margin .2s ease;
}

/* Modal */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #0f1222;
  color: #f0f3fa;
  width: 720px;
  max-width: 92vw;
  border: 1px solid #2a2e46;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

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

.modal-body {
  padding: 14px 16px;
}

.users-list .user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #2a2e46;
  padding: 8px 0;
}

.users-list .user-row .meta small {
  opacity: .8;
}

.progress-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.rail-part {
  background: #ddd;
  transition: background 0.3s;
}


.status-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.status-line .seg {
  border-right: 1px solid rgba(0, 0, 0, .06);
}

.status-line .seg:last-child {
  border-right: none;
}

.seg-off {
  background: #d9d9d9;
}

.seg-done {
  background: #2e7d32;
}

/* concluído */
.seg-warn {
  background: #ff9d0a;
}

/* 3-4 dias */
.seg-late {
  background: #c62828;
}

/* 5+ dias */
.seg-info {
  background: #292972;
}

/* não usado aqui, mas mantido */



.seg-off {
  background: #dcdcdc;
}

.seg-ok {
  background: #4caf50;
}

.seg-warn {
  background: #ffc107;
}

.seg-bad {
  background: #f44336;
}



.status-rail {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 8px;
  gap: 4px;
}

.seg {
  font-size: 10px;
  text-align: center;
  line-height: 26px;
  color: #fff;
}

.seg-off {
  background: #cccccc;
  color: #444;
}

.seg-ok {
  background: #2ecc71;
}

.seg-yellow {
  background: #f1c40f;
}

.seg-red {
  background: #e74c3c;
}

.card-subtitle {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.card-meta {
  font-size: 12px;
  margin-top: 4px;
  color: #444;
}

.card-days {
  font-size: 12px;
  margin-top: 4px;
  font-weight: bold;
  color: #555;
}

/* Adicione isso no seu style.css */
/* === STATUS TIMELINE === */
.status-timeline {
  display: flex;
  height: 6px;
  margin: 8px 0;
  border-radius: 3px;
  overflow: hidden;
  background: #f0f0f0;
}

.status-segment {
  flex: 1;
  margin: 0 1px;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Cores para cada status */
.segment-abertos {
  background-color: #4caf50;
}

/* verde */
.segment-em_atendimento {
  background-color: #2196f3;
}

/* azul */
.segment-atendimento_externo {
  background-color: #ff9800;
}

/* laranja */
.segment-em_homologacao {
  background-color: #9c27b0;
}

/* roxo */
.segment-em_implementacao {
  background-color: #607d8b;
}

/* cinza */

/* Estados de alerta */
.alert-3-4 {
  background-color: #ffeb3b !important;
  /* amarelo */
  animation: pulse 2s infinite;
}

.alert-5-plus {
  background-color: #f44336 !important;
  /* vermelho */
  animation: pulse 1s infinite;
}

.no-data {
  background-color: #e0e0e0 !important;
  /* cinza claro */
  opacity: 0.5;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

/* Cores para dias críticos */
.segment-abertos.alert-3-4 {
  background-color: #FFC107;
}

/* Amarelo */
.segment-abertos.alert-5-plus {
  background-color: #F44336;
}

/* Vermelho */

.segment-em_atendimento.alert-3-4 {
  background-color: #FFC107;
}

.segment-em_atendimento.alert-5-plus {
  background-color: #F44336;
}

.segment-atendimento_externo.alert-3-4 {
  background-color: #FFC107;
}

.segment-atendimento_externo.alert-5-plus {
  background-color: #F44336;
}

.segment-em_homologacao.alert-3-4 {
  background-color: #FFC107;
}

.segment-em_homologacao.alert-5-plus {
  background-color: #F44336;
}

.segment-em_implementacao.alert-3-4 {
  background-color: #FFC107;
}

.segment-em_implementacao.alert-5-plus {
  background-color: #F44336;
}

/* Adicione isso no seu style.css */
.status-timeline {
  width: 100%;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  display: flex;
  margin-bottom: 8px;
  overflow: hidden;
}

.status-segment {
  flex: 1;
  height: 100%;
  transition: background-color 0.3s ease;
  position: relative;
}

.status-segment:not(:last-child) {
  border-right: 1px solid white;
}

/* Cores base (verde) para todos os status */
.segment-abertos {
  background-color: #4CAF50;
}

.segment-em_atendimento {
  background-color: #4CAF50;
}

.segment-atendimento_externo {
  background-color: #4CAF50;
}

.segment-em_homologacao {
  background-color: #4CAF50;
}

.segment-em_implementacao {
  background-color: #4CAF50;
}

/* Cores para dias críticos */
.status-segment.alert-3-4 {
  background-color: #FFC107 !important;
}

/* Amarelo */
.status-segment.alert-5-plus {
  background-color: #F44336 !important;
}

/* Vermelho */

/* Para status não atingidos (sem data) */
.status-segment.no-data {
  background-color: #e0e0e0 !important;
  opacity: 0.5;
}

.status-line {
  display: flex;
  height: 14px;
  margin-bottom: 4px;
}

.seg {
  flex: 1;
  position: relative;
}

.seg-days {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ffffff;
}

.seg-off {
  background: #bdbdbd;
}

.seg-ok {
  background: #43a047;
}

.seg-warn {
  background: #fbc02d;
}

.seg-bad {
  background: #e53935;
}


.card .status-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
}

/* ===== Rework Icon ===== */
.rework-ico {
  color: #1976d2;
  margin-left: 6px;
  font-weight: bold;
}

/* ===== Custom Alert Modal ===== */
.custom-alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.custom-alert-modal {
  background: white;
  border-radius: 16px;
  padding: 24px;
  min-width: 320px;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.custom-alert-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-alert-icon {
  font-size: 24px;
}

.custom-alert-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a2258;
}

.custom-alert-message {
  color: #333;
  margin-bottom: 20px;
  line-height: 1.5;
}

.custom-alert-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.custom-alert-btn {
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-alert-btn-primary {
  background: #ff9d0a;
  color: white;
}

.custom-alert-btn-primary:hover {
  background: #e68d00;
}

.custom-alert-btn-secondary {
  background: #e9ecff;
  color: #1a2258;
}

.custom-alert-btn-secondary:hover {
  background: #d4d9ff;
}


.user-menu-btn {
  border: none;
  background: #e9ecff;
  color: #1a2258;
  padding: 8px 14px;
  margin-left: 8px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu-btn:hover {
  background: #d4d9ff;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  display: none;
  z-index: 100;
}

.user-menu-dropdown.open {
  display: block;
  animation: slideDown 0.2s ease;
}

.user-menu-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a2258;
  transition: background 0.2s;
}

.user-menu-item:first-child {
  border-radius: 12px 12px 0 0;
}

.user-menu-item:last-child {
  border-radius: 0 0 12px 12px;
}

.user-menu-item:hover {
  background: #f5f7ff;
}

.user-menu-item-icon {
  font-size: 18px;
}

/* ===== Notification Badge ===== */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53935;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ===== Notifications Panel ===== */
.notifications-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
}

.notifications-overlay.open {
  display: flex;
}

.notifications-modal {
  background: white;
  min-width: 400px;
  max-width: 500px;
  width: 90%;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-height: 80vh;
  /* Limits height to fit below header */
  overflow: hidden;
  /* Main container hides overflow, inner list scrolls */
}

.notifications-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notifications-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a2258;
}

.notifications-close {
  border: none;
  background: #e9ecff;
  color: #1a2258;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

.notifications-close:hover {
  background: #d4d9ff;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.notification-item {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.2s;
}

.notification-item:hover {
  background: #eef1ff;
}

.notification-item.unread {
  background: #fff4e5;
  border-left: 4px solid #ff9d0a;
}

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

.notification-item-title {
  font-weight: 600;
  color: #1a2258;
  font-size: 14px;
}

.notification-item-time {
  font-size: 12px;
  color: #666;
}

.notification-item-message {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.notification-item-ticket {
  display: inline-block;
  background: #e9ecff;
  color: #1a2258;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.notifications-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== DARK MODE ===== */
body.dark-mode {
  background: #1a1a2e;
  color: #eee;
}

body.dark-mode .app-header {
  background: #16213e;
  border-bottom-color: #0f3460;
}

body.dark-mode .tab-btn {
  background: #0f3460;
  color: #eee;
}

body.dark-mode .tab-btn.active {
  background: #ff9d0a;
  color: #fff;
}

body.dark-mode .board-empty,
body.dark-mode .column {
  background: #16213e;
  border-color: #0f3460;
}

body.dark-mode .card {
  background: #0f3460;
  border-color: #1a1a2e;
  color: #eee;
}

body.dark-mode .card-title {
  color: #ff9d0a;
}

body.dark-mode .modal-content {
  background: #16213e;
  color: #eee;
}

body.dark-mode .modal-content-not {
  background: #16213e;
  color: #eee;
}

body.dark-mode #user-dropdown {
  background: #0f3460 !important;
  border-color: #1a1a2e !important;
  color: #eee;
}

body.dark-mode .user-menu-item:hover {
  background: #1a1a2e !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #0f3460;
  color: #eee;
  border-color: #1a1a2e;
}

body.dark-mode .col-header {
  background: #0f3460;
  color: #ff9d0a;
}

body.dark-mode .sidebar {
  background: #16213e;
  color: #eee;
}

body.dark-mode .detail-key {
  color: #ff9d0a;
}

body.dark-mode .detail-val {
  color: #eee;
}

/* User Selection Modal */
.user-selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.user-selection-item {
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
  background: #f9f9f9;
  color: #333;
}

.user-selection-item:hover {
  background: #ffffff;
  border-color: #ff9d0a;
}

body.dark-mode .user-selection-item {
  background: #16213e;
  border-color: #2e3b55;
  color: #eee;
}

body.dark-mode .user-selection-item:hover {
  background: #1a1a2e;
  border-color: #ff9d0a;
}

/* HEADER BASE – 3 ZONAS FIXAS */
.app-header {
  position: relative;
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

/* LOGOS – permanecem no canto esquerdo */
.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
}


/* OCULTAR LOGIN SE USUÁRIO ESTÁ LOGADO */
#btn-login-header {
  display: none !important;
}

/* BOTÃO DO USUÁRIO – FIXO NO CANTO DIREITO */
#user-menu-container {
  position: absolute;
  right: 24px;
  /* FIXO DA DIREITA */
  top: 50%;
  /* CENTRALIZA VERTICALMENTE NO HEADER */
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

/* Typing animation for AI Chat */
.typing-dots {
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
  font-weight: bold;
  letter-spacing: 2px;
  color: #666;
}

@keyframes typing {
  0% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.2;
  }
}

/* AI Chat specific styles */
#ai-chat-body .bot-msg {
  background: #f1f1f1;
  color: #333;
}

#ai-chat-body .user-msg {
  background: #dcf8c6;
  color: #333;
}

/* Notification Window Adjustments */
#notifications-overlay {
  justify-content: flex-end;
  padding-right: 20px;
}