:root{
  --card-actions-font: 16px;
  --card-actions-icon: 12px;
}

.card { 
    background: var(--card-bg); 
    border-radius: var(--radius-card, 6px); 
    padding: 8px; 
    margin-bottom: 8px; 
    box-shadow: var(--shadow-card, 0 1px 2px rgba(0,0,0,0.1)); 
    border-left: 4px solid transparent; 
    color: #333; 
    position: relative; 
    font-size: 0.8em; 
    cursor: grab; 
    transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover, 0 1px 2px rgba(0,0,0,0.1)); }

/* Ghost invisível: cards na coluna destino não se rearranjam durante o drag */
.sortable-ghost-hidden {
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
}
.card.SIBS { border-left-color: var(--color-sibs); }
.card.SCML { border-left-color: var(--color-scml); }
.card.GERAL { border-left-color: var(--color-geral); }
.card.DEFAULT { border-left-color: #bdc3c7; }
.card.pr-closed { opacity: 0.5; filter: grayscale(0.8); }
.card.pr-closed .card-title { text-decoration: line-through; }

/* Sidebar Card */
.sidebar-card { border-left-color: #95a5a6; padding: 10px; }
.sidebar-card.DEFAULT { background: white; border-left-color: #bdc3c7; }

/* Badges */
.badge-new { background: var(--color-new); color: white; font-size: 0.85em; padding: 2px 8px; border-radius: 10px; font-weight: bold; box-shadow: 0 0 6px rgba(46, 204, 113, 0.3); }
.badge-updated { 
    background: var(--color-updated); color: white; font-size: 0.85em; padding: 2px 8px; border-radius: 10px; font-weight: bold;
    box-shadow: 0 0 6px rgba(230, 126, 34, 0.25);
}
.badge-closed {
    background: #c0392b; color: white; font-size: 0.85em; padding: 2px 8px; border-radius: 10px; font-weight: bold;
    box-shadow: 0 0 6px rgba(192, 57, 43, 0.25);
}

/* Texto de Razão do Update */
.update-reason-text {
    font-size: 0.75em; color: #e67e22; background: #fff3e0; padding: 2px 6px; border-radius: 4px; margin-top: 5px; margin-bottom: 2px; border: 1px dashed #e67e22; display: inline-block; font-weight: 600;
}

/* Contexto do Pai (Inbox) */
.parent-context {
    font-size: 0.7em; color: #888; background: #f8f9fa; padding: 2px 4px; border-radius: 3px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Ações Sidebar */
.sidebar-actions { 
    display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 6px; border-top: 1px solid #f0f0f0; gap: 5px; 
}
.actions-buttons { display: flex; gap: 8px; }
.btn-aceitar { background: none; border: 1px solid var(--color-accept); color: var(--color-accept); font-size: 0.75em; padding: 2px 8px; border-radius: 3px; cursor: pointer; font-weight: bold; }
.btn-aceitar:hover { background: var(--color-accept); color: white; }
.btn-rejeitar { background: none; border: 1px solid #e74c3c; color: #e74c3c; font-size: 0.75em; padding: 2px 8px; border-radius: 3px; cursor: pointer; font-weight: bold; transition: all 0.2s; }
.btn-rejeitar:hover { background: #e74c3c; color: white; }


/* --- LAYOUT DO CARTÃO --- */
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 5px; }
.card-id a { color: #666; text-decoration: none; font-weight: bold; }
.card-id a:hover { color: var(--color-accept); }

.id-prefix { font-weight: 900; font-size: 1.4em; letter-spacing: 0.3px; }

.fu-hierarchy {
    font-size: 0.74em;
    color: #999;
    opacity: 0.7;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fu-hierarchy-sep { opacity: 0.6; margin: 0 2px; }

.header-center-stats { flex-grow: 1; text-align: center; font-size: 0.75em; color: #666; font-weight: 600; border-bottom: 1px dotted #ccc; margin: 0 5px; }

.card-tag { font-size: 0.65em; font-weight: 900; padding: 1px 4px; border-radius: 3px; color: white; }
.card-tag.SIBS { background: var(--color-sibs); }
.card-tag.SCML { background: var(--color-scml); }
.card-tag.GERAL { background: var(--color-geral); }
.card-tag.DEFAULT { background: #bdc3c7; color: #444; }

.type-select { border: none; font-size: 0.75em; font-weight: bold; color: white; padding: 1px 3px; border-radius: 2px; cursor: pointer; }
.type-select.SIBS { background: var(--color-sibs); }
.type-select.SCML { background: var(--color-scml); }
.type-select.GERAL { background: var(--color-geral); }
.type-select.DEFAULT { background: #bdc3c7; color: #444; }

/* Substitui o bloco .card-title e .card-title:hover por isto */
.card-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #222;
    /* mantém 1 linha */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    cursor: default;
    /* necessário para a animação ficar “contida” */
    position: relative;
}
/* o span interno é o que “anda” */
.card-title .title-text {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

/* só anima quando o JS marcar como overflow */
.card-title.is-overflow:hover .title-text {
    animation: title-marquee 7s linear infinite;
}

@keyframes title-marquee {
    0%, 15%   { transform: translateX(0); }
    85%, 100% { transform: translateX(calc(-1 * var(--title-scroll, 0px))); }
}

/* acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .card-title.is-overflow:hover .title-text {
        animation: none;
    }
}

/* PR com WO UPDATED na Inbox: marca leve permanente + glow só no hover da inbox */
.card.has-inbox-update {
  box-shadow:
    0 0 0 2px rgba(230, 126, 34, 0.75),
    0 1px 2px rgba(0,0,0,0.1);
}

.card.inbox-parent-glow {
  animation: neon-pulse-orange 1.2s infinite ease-in-out;
}

@keyframes neon-pulse-orange {
  0%, 100% {
    box-shadow:
      0 0 0 2px var(--color-updated),
      0 0 0 0 rgba(230, 126, 34, 0.35),
      0 1px 2px rgba(0,0,0,0.1);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--color-updated),
      0 0 18px 4px rgba(230, 126, 34, 0.85),
      0 1px 2px rgba(0,0,0,0.1);
  }
}


.card-title:hover { 
    color: #000; 
    /* REMOVIDO: white-space: normal (Isto é que causava os saltos) */
}
/* --- RODAPÉ DO CARTÃO (Data + Input) --- */
.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid #f0f0f0;
    gap: 4px; 
    white-space: nowrap; /* Linha Única Obrigatória */
}

.footer-date {
    color: #888;
    font-size: 0.8em;
    flex-shrink: 0;
    margin-right: auto; 
}

.footer-fu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0; 
}

.footer-fu label {
    font-weight: bold; 
    font-size: 0.8em;
    color: #555;
    margin-right: 2px;
}

.footer-fu input {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0px 2px;
    width: 85px;       /* Largura fixa otimizada */
    font-size: 11px;   /* Letra legível */
    height: 20px;
    color: #333;
    background: #fff;
    font-family: inherit;
}

.btn-clear-date {
    background: none; border: none; color: #999; cursor: pointer; font-size: 1.1em; line-height: 1; padding: 0 2px; display: flex; align-items: center;
}
.btn-clear-date:hover { color: #e74c3c; }


/* --- BARRA DE AÇÕES (FU notes + Tree + Notas) --- */
.card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    border-top: 1px dotted #eee;
    padding-top: 4px;
    gap: 6px;
    font-size: var(--card-actions-font);
    line-height: 1.15;
}

.card-actions-left,
.card-actions-right {
    display: flex;
    align-items: center;
}

.card-actions-left .tree-toggle {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.72em;
    color: #3498db;
    font-weight: bold;
    display: inline-block;
    width: auto;
    height: auto;
    line-height: normal;
    text-align: left;
}
.card-actions-left .tree-toggle:hover {
    color: #2980b9;
    text-decoration: underline;
}

.card-actions-right .notes-trigger {
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.72em;
    color: #3498db;
    font-weight: bold;
}
.card-actions-right .notes-trigger:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* --- ÁRVORE DE DEPENDÊNCIAS --- */
.tree-details { font-size: 0.9em; padding-top: 6px; }
.tree-item { margin-bottom: 6px; border-left: 2px solid #ddd; padding-left: 8px; }
.tree-item-header.closed { color: var(--color-closed) !important; text-decoration: line-through; opacity: 0.6; }
.sr-type-badge { font-size: 0.8em; font-weight: bold; padding: 0 4px; border-radius: 3px; margin-left: 5px; color: #444; background: #e0e0e0; text-transform: uppercase; }
.sr-title-text { font-size: 0.82em; color: #666; font-style: italic; margin: 2px 0 4px; line-height: 1.3; }
.wo-list { margin-left: 10px; border-left: 1px dashed #ccc; padding-left: 8px; margin-top: 3px; }
.wo-item { margin-bottom: 2px; font-size: 0.85em; }


.card-title[href] {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* --- REMOVIDOS: botão de acknowledge --- */
.btn-removed-ack {
    margin-left: auto;
    padding: 1px 7px;
    font-size: 0.72em;
    border: 1px solid #4a9;
    border-radius: 3px;
    background: transparent;
    color: #4a9;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.btn-removed-ack:hover {
    background: #4a9;
    color: #fff;
}
.removed-item .rid {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === WO RED GLOW === */
@keyframes red-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 50, 50, 0); }
    50%       { box-shadow: 0 0 10px 4px rgba(220, 50, 50, 0.55); }
}
.card.has-wo-red-glow {
    border: 1px solid rgba(220, 60, 60, 0.7) !important;
    animation: red-pulse 2.2s ease-in-out infinite;
}

/* === LOG FILE BUTTONS === */
.log-file-btn {
    background: #f0f2f5;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: #555;
    padding: 5px 12px;
    font-size: 0.82em;
    cursor: pointer;
    transition: background 0.15s;
}
.log-file-btn:hover { background: #e4e7eb; }
.log-file-btn.active { background: #3498db; color: #fff; border-color: #2980b9; }

/* === ARCHIVE ENTRIES === */
.archive-entry {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 7px;
    padding: 10px 14px;
}
.arc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.arc-id { color: #2980b9; font-weight: 700; text-decoration: none; }
.arc-id:hover { text-decoration: underline; }
.arc-status { font-size: 0.78em; background: #e9ecef; padding: 2px 7px; border-radius: 4px; color: #666; }
.arc-dates { font-size: 0.76em; opacity: 0.6; margin-left: auto; }
.arc-title { font-size: 0.88em; opacity: 0.85; }
.arc-note { font-size: 0.80em; color: #27ae60; margin-top: 5px; opacity: 0.9; }

/* === DATE FILTER === */
.btn-date-toggle {
    background: #2a2d3e;
    border: 1px solid #3a3d5a;
    border-radius: 5px;
    color: #bcc;
    padding: 4px 9px;
    font-size: 0.88em;
    cursor: pointer;
    margin-left: 5px;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn-date-toggle:hover { background: #353850; }
.btn-date-toggle.date-filter-active {
    border-color: #5a9fc5;
    color: #8ecae6;
    background: #253048;
}

.date-filter-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 4px 2px;
}
.date-filter-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.date-filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82em;
    color: #bcc;
    cursor: pointer;
    white-space: nowrap;
}
.date-filter-sep {
    font-size: 0.80em;
    opacity: 0.6;
    white-space: nowrap;
}
.date-filter-input {
    background: #252840;
    border: 1px solid #3a3d5a;
    border-radius: 5px;
    padding: 3px 7px;
    color: #eee;
    font-size: 0.82em;
    cursor: pointer;
}
.date-filter-input:focus { outline: none; border-color: #5a9fc5; }
.btn-date-clear {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 5px;
    border-radius: 4px;
}
.btn-date-clear:hover { color: #f87; background: #2a1a1a; }

/* webGP v3.0: follow-up 10% mais compacto, sem reorganização */
#board-followup .kanban-card { font-size:90%; padding:9px; margin-bottom:9px; }
#board-followup .card-title, #board-followup .card-header, #board-followup .card-actions { gap:6px; }
