/* ============================================================
   Dito! — Tema visual
   Importar APÓS o Bootstrap.
   ============================================================ */

/* ------------------------------------------------------------
   1. Variáveis do Bootstrap
   ------------------------------------------------------------ */
:root {
    /* Cor principal */
    --bs-primary: #183B5C;
    --bs-primary-rgb: 24, 59, 92;

    /* Fundo e texto */
    --bs-body-bg: #FAFAFA;
    --bs-body-color: #1A1A1A;
    --bs-body-font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    --bs-body-font-size: 0.9375rem;
    --bs-body-line-height: 1.6;
    --bs-body-font-weight: 500;

    /* Bordas */
    --bs-border-color: #DAD6CD;
    --bs-border-width: 0.5px;
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: 10px;

    /* Links */
    --bs-link-color: #183B5C;
    --bs-link-hover-color: #16304D;

    /* Superfícies */
    --bs-card-bg: #FFFFFF;
    --bs-modal-bg: #FFFFFF;

    /* Secundária */
    --bs-secondary-color: #6E6E6E;
    --bs-secondary-bg: #FAFAFA;

    /* Estados semânticos */
    --bs-success: #2F7D4F;
    --bs-danger: #C0392B;
    --bs-warning: #B8860B;

    /* Tipografia */
    --bs-headings-font-family: 'Lora', serif;
    --bs-headings-font-weight: 700;
    --bs-headings-color: #1A1A1A;
}

/* ------------------------------------------------------------
   2. Variáveis internas do Dito!
   ------------------------------------------------------------ */
:root {
    /* Âmbar — reservado para BOTÕES e contornos de ação */
    --dito-ambar: #B8860B;
    --dito-ambar-escuro: #8C6408;
    --dito-ambar-claro: #FBF3DF;

    /* Azul da logo — links, ícones, textos de apoio e painéis */
    --dito-vinho: #183B5C;
    --dito-vinho-escuro: #16304D;
    --dito-vinho-claro: #EEF2F6;
    --dito-dourado: #B8860B;
    --dito-dourado-claro: #FBF3DF;
    --dito-bege: #DAD6CD;
    --dito-grafite: #1A1A1A;
}

/* ------------------------------------------------------------
   3. Ajustes globais
   ------------------------------------------------------------ */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Lora', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn {
    font-weight: 700;
    letter-spacing: 0;
}

.card {
    border: 0.5px solid var(--dito-bege);
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* ------------------------------------------------------------
   4. Overrides de botões e links (Bootstrap)
   ------------------------------------------------------------ */

/* Botão primário — grená */
.btn-primary {
    --bs-btn-bg: var(--dito-vinho);
    --bs-btn-border-color: var(--dito-vinho);
    --bs-btn-hover-bg: var(--dito-vinho-escuro);
    --bs-btn-hover-border-color: var(--dito-vinho-escuro);
    --bs-btn-active-bg: var(--dito-vinho-escuro);
    --bs-btn-active-border-color: var(--dito-vinho-escuro);
    --bs-btn-disabled-bg: var(--dito-vinho);
    --bs-btn-disabled-border-color: var(--dito-vinho);
}

/* Botão outline primário — grená */
.btn-outline-primary {
    --bs-btn-color: var(--dito-vinho);
    --bs-btn-border-color: var(--dito-vinho);
    --bs-btn-hover-bg: var(--dito-vinho);
    --bs-btn-hover-border-color: var(--dito-vinho);
    --bs-btn-active-bg: var(--dito-vinho);
    --bs-btn-active-border-color: var(--dito-vinho);
}

/* Links — grená */
a {
    color: var(--dito-vinho);
}

a:hover {
    color: var(--dito-vinho-escuro);
}

/* ------------------------------------------------------------
   5. Badges de status   (bloco 3 da Etapa 4)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   6. Sidebar, header e layout autenticado
   ------------------------------------------------------------ */

/* Layout geral */
.dito-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.dito-sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: #0F2338;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.25s ease;
    overflow: hidden;
    z-index: 200;
}

.dito-sidebar.collapsed { width: 64px; }

/* Header da sidebar */
.dito-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
    flex-shrink: 0;
}

.dito-sidebar-logo-full {
    height: 28px;
    transition: opacity 0.2s ease;
}

.dito-sidebar-logo-icon {
    height: 28px;
    display: none;
}

.dito-sidebar.collapsed .dito-sidebar-logo-full { display: none; }
.dito-sidebar.collapsed .dito-sidebar-logo-icon { display: block; }

/* Nav */
.dito-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.dito-nav-section {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #B8C6D6;
    opacity: 0.4;
    padding: 0.75rem 0.75rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.dito-sidebar.collapsed .dito-nav-section { opacity: 0; }

.dito-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    color: #B8C6D6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.8;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.dito-nav-item:hover,
.dito-nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    color: #FFFFFF;
}

.dito-nav-item.active {
    box-shadow: inset 3px 0 0 #E1C4A1;
}

.dito-nav-item i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.dito-nav-label {
    overflow: hidden;
    max-width: 200px;
    transition: opacity 0.2s ease, max-width 0.25s ease;
}

.dito-sidebar.collapsed .dito-nav-label {
    opacity: 0;
    max-width: 0;
}

/* Footer da sidebar */
.dito-sidebar-footer {
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.dito-collapse-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    color: #B8C6D6;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.65;
    width: 100%;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.dito-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.dito-collapse-btn i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    transition: transform 0.25s ease;
}

.dito-sidebar.collapsed .dito-collapse-btn i {
    transform: rotate(180deg);
}

.dito-collapse-label {
    overflow: hidden;
    max-width: 200px;
    transition: opacity 0.2s ease, max-width 0.25s ease;
}

.dito-sidebar.collapsed .dito-collapse-label {
    opacity: 0;
    max-width: 0;
}

/* ---- Área principal ---- */
.dito-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
}

/* ---- Header ---- */
.dito-header {
    height: 64px;
    background: #FFFFFF;
    border-bottom: 0.5px solid #DAD6CD;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.dito-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dito-header-title {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A1A1A;
}

.dito-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dito-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.dito-user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.2;
}

.dito-user-tipo {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6E6E6E;
    line-height: 1.2;
}

.dito-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: none;
    border: 0.5px solid #DAD6CD;
    border-radius: 6px;
    color: #6E6E6E;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.dito-logout-btn:hover {
    border-color: #183B5C;
    color: #183B5C;
}

/* ---- Conteúdo ---- */
.dito-content {
    flex: 1;
    padding: 2rem 1.5rem;
}

/* ------------------------------------------------------------
   7. Busca e retranca
   ------------------------------------------------------------ */

.dito-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    border: 0.5px solid var(--dito-bege);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dito-search:focus-within {
    border-color: var(--dito-vinho);
    box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.12);
}

.dito-search input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 14px;
    color: var(--dito-grafite);
    flex: 1;
    min-width: 0;
}

.dito-search input::placeholder {
    color: #B4B2A9;
}

.dito-retranca {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--dito-ambar-escuro);
    background: var(--dito-ambar-claro);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Busca em destaque (modificador) */
.dito-search-lg {
    padding: 14px 18px;
    border-radius: 12px;
}

.dito-search-lg input {
    font-size: 1rem;
}

.dito-search-lg i {
    font-size: 1.1rem;
}

.dito-search-lg:focus-within {
    box-shadow: 0 0 0 4px rgba(27, 58, 92, 0.14);
}

/* ------------------------------------------------------------
   8. Utilitários específicos — Dashboard
   ------------------------------------------------------------ */

/* Cards de estatísticas */
.dito-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.dito-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.dito-stat-number {
    font-family: 'Lora', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.dito-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6E6E6E;
}

/* Cards de status (visão coordenação) */
.dito-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: #FFFFFF;
    border: 0.5px solid #DAD6CD;
    border-radius: 8px;
}

.dito-status-count {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A1A1A;
}

/* Estado vazio */
.dito-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #6E6E6E;
}

.dito-empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.dito-empty-state p {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* Card com conteúdo colado nas bordas (corta cantos internos) */
.dito-card-flush {
    overflow: hidden;
}

/* ------------------------------------------------------------
   Popover de Datas (tela de Imagens)
   ------------------------------------------------------------ */

.dito-datas-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #FFFFFF;
    border: 0.5px solid #DAD6CD;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(28, 28, 26, 0.15);
    padding: 10px 12px;
    min-width: 220px;
    text-align: left;
    margin-top: 4px;
}

.dito-datas-popover.show {
    display: block;
}

.dito-datas-popover-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.75rem;
    padding: 3px 0;
    border-bottom: 0.5px solid #DAD6CD;
}

.dito-datas-popover-item:last-child {
    border-bottom: none;
}

.dito-datas-popover-item span {
    color: #6E6E6E;
}

.dito-datas-popover-item strong {
    color: #1A1A1A;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   Rótulo de campo de filtro
   ------------------------------------------------------------ */

.dito-filtro-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6E6E6E;
    margin-bottom: 4px;
}

/* ------------------------------------------------------------
   Painel de Ações em Massa
   ------------------------------------------------------------ */

.dito-acao-massa {
    background: var(--dito-vinho-claro);
    border: 0.5px solid var(--dito-vinho);
    border-left: 3px solid var(--dito-vinho);
    border-radius: 8px;
    padding: 12px 16px;
}

.dito-contador-badge {
    background: #FFFFFF;
    border: 0.5px solid var(--dito-vinho);
    color: var(--dito-vinho-escuro);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: auto;
}

/* ------------------------------------------------------------
   Toggle de Filtros Avançados
   ------------------------------------------------------------ */

.dito-filtros-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: none;
    border-top: 0.5px solid #DAD6CD;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #183B5C;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dito-filtros-toggle:hover {
    background: #FBF3DF;
}

/* ------------------------------------------------------------
   Tabela de dados (listagem de imagens)
   ------------------------------------------------------------ */

.dito-tabela {
    table-layout: fixed;
    width: 100%;
}

.dito-tabela thead th {
    text-align: center;
    vertical-align: middle;
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dito-grafite);
    background: #FFFFFF;
    border-bottom: 0.5px solid var(--dito-bege);
    white-space: nowrap;
}

.dito-tabela tbody td {
    vertical-align: middle;
    padding: 12px 8px;
    font-size: 0.8rem;
    height: 78px;
}
/* Larguras das colunas — soma 100% */
.dito-tabela th:nth-child(1),
.dito-tabela td:nth-child(1) { width: 13%; }   /* Retranca */

.dito-tabela th:nth-child(2),
.dito-tabela td:nth-child(2) { width: 11%; }   /* Obra/Comp. */

.dito-tabela th:nth-child(3),
.dito-tabela td:nth-child(3) { width: 11%; }   /* Responsáveis */

.dito-tabela th:nth-child(4),
.dito-tabela td:nth-child(4) { width: 7%; }    /* Arquivos */

.dito-tabela th:nth-child(5),
.dito-tabela td:nth-child(5) { width: 12%; }   /* Status */

.dito-tabela th:nth-child(6),
.dito-tabela td:nth-child(6) { width: 11%; }   /* Pagamento Desc. */

.dito-tabela th:nth-child(7),
.dito-tabela td:nth-child(7) { width: 11%; }   /* Pagamento Rev. */

.dito-tabela th:nth-child(8),
.dito-tabela td:nth-child(8) { width: 6%; }    /* Datas */

.dito-tabela th:nth-child(9),
.dito-tabela td:nth-child(9) { width: 11%; }   /* Ações */

/* Colunas com conteúdo centralizado */
.dito-tabela td:nth-child(1),   /* Retranca */
.dito-tabela td:nth-child(4),   /* Arquivos */
.dito-tabela td:nth-child(5),   /* Status */
.dito-tabela td:nth-child(8),   /* Datas */
.dito-tabela td:nth-child(9) {  /* Ações */
    text-align: center;
}

/* Célula com duas linhas (Obra/Componente, Responsáveis) */
.dito-celula-dupla {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.dito-celula-dupla .principal {
    font-weight: 700;
    color: var(--dito-grafite);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dito-celula-dupla .secundaria {
    font-size: 0.72rem;
    color: #6E6E6E;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Selects de pagamento — largura fluida dentro da célula */
.dito-tabela .form-select-sm {
    width: 100%;
    font-size: 0.72rem;
    min-width: 0;
}

/* Linhas de responsável (Descritor / Revisor) — mesmo peso e cor */
.dito-responsavel-linha {
    font-size: 0.75rem;
    color: var(--dito-grafite);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dito-responsavel-linha .rotulo {
    color: #6E6E6E;
    font-weight: 700;
    margin-right: 3px;
}

/* ------------------------------------------------------------
   Coluna de Ações (listagem de imagens)
   ------------------------------------------------------------ */

.dito-acoes-celula {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.dito-acoes-celula form {
    width: auto;
    margin: 0;
}

.dito-acoes-celula .form-select-sm {
    width: 140px;
    max-width: 100%;
    font-size: 0.72rem;
}

.dito-acoes-botoes {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

/* ------------------------------------------------------------
   Barra de progresso por status (tela de Lotes)
   ------------------------------------------------------------ */

.dito-progresso-barra {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: #EFF2F6;
}

.dito-progresso-segmento {
    height: 100%;
    transition: opacity 0.15s ease;
}

.dito-progresso-segmento:hover {
    opacity: 0.75;
}

.dito-progresso-legenda {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #6E6E6E;
}

.dito-progresso-legenda strong {
    color: var(--dito-grafite);
}

.dito-progresso-ponto {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* Cores por status — só as 2 primeiras etapas ficam em azul; o âmbar
   entra a partir de "Descrito" e o verde fica reservado pro final. */
.dito-progresso-liberado-descricao   { background: #6E96BC; }
.dito-progresso-descrevendo          { background: #2A5CAD; }
.dito-progresso-descrito             { background: #F0D48A; }
.dito-progresso-liberado-conferencia { background: #E0B84D; }
.dito-progresso-em-conferencia       { background: #D9A521; }
.dito-progresso-conferido            { background: #C9941A; }
.dito-progresso-revisando            { background: #B8860B; }
.dito-progresso-revisado             { background: #8C6408; }
.dito-progresso-finalizado           { background: #2F7D4F; }


/* ------------------------------------------------------------
   Card clicável (imagens avulsas)
   ------------------------------------------------------------ */

.dito-card-link {
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.dito-card-link:hover {
    border-color: var(--dito-vinho);
    transform: translateX(2px);
}
/* ============================================================
   Reforço de âmbar nos pontos de interação (botões-ícone de ação
   e cards em destaque), pra ele aparecer mais espalhado pela tela
   em vez de só nos botões primários.
   ============================================================ */

.dito-btn-acao {
    color: #B8860B;
    border-color: rgba(184, 134, 11, 0.35);
}
.dito-btn-acao:hover {
    background: #B8860B;
    color: #FFFFFF;
    border-color: #B8860B;
}

.dito-card-destaque {
    border-left: 3px solid #B8860B;
}

