/* ============================================================
   OPUS — Tema principal
   ============================================================ */

:root {
    --primary:       #e8722a;
    --primary-light: #f59055;
    --navy:          #1e2d4a;
    --bg:            #eef0f4;
    --card-bg:       #ffffff;
    --text:          #111827;
    --text-muted:    #9ca3af;
    --border:        #e5e7eb;
    --nav-height:    58px;
    --nav-float:     12px;
    --nav-bg:        rgba(40,42,54,0.96);
    --nav-border:    rgba(255,255,255,.08);

    /* Cores semânticas — usadas em botões, badges e alertas */
    --success:       #16a34a;
    --success-light: #22c55e;
    --success-bg:    #f0fdf4;
    --success-border:#86efac;
    --danger:        #dc2626;
    --danger-light:  #ef4444;
    --danger-bg:     #fef2f2;
    --danger-border: #fecaca;
    --warning:       #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg:    #fffbeb;
    --warning-border:#fde68a;
    --info:          #3b82f6;
    --info-light:    #60a5fa;
    --info-bg:       #eff6ff;
    --info-border:   #bfdbfe;
    --neutral:       #64748b;
    --neutral-bg:    #f1f5f9;
    --neutral-border:#e2e8f0;

    /* ============================================================
       FUNDAÇÃO DE DESIGN (redesign 2026) — vocabulário único.
       Regra: nenhum hex/px solto no código novo. Cor via var(--*),
       espaço via --s-*, raio via --r-*, sombra via --shadow-*.
       Os tokens legados acima foram mantidos pra não quebrar telas;
       o redesign migra cada tela pra estes aos poucos.
       ============================================================ */

    /* Escala de cinza — a cor dominante da UI */
    --gray-50:#f8fafc;  --gray-100:#f1f5f9; --gray-200:#e2e8f0;
    --gray-300:#cbd5e1; --gray-400:#94a3b8; --gray-500:#64748b;
    --gray-600:#475569; --gray-700:#334155; --gray-800:#1e293b; --gray-900:#0f172a;

    /* Superfícies e texto (semânticos) */
    --surface:    #ffffff;
    --surface-2:  var(--gray-50);
    --border-strong: var(--gray-300);
    --text-2:     var(--gray-600);   /* texto secundário (entre --text e --text-muted) */

    /* Espaçamento — múltiplos de 4px, ÚNICA fonte */
    --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px;
    --s-5:20px; --s-6:24px; --s-8:32px; --s-10:40px;

    /* Raio — só dois + pílula */
    --r-sm:6px; --r-md:12px; --r-pill:999px;

    /* Sombra — só dois níveis */
    --shadow-1:0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
    --shadow-2:0 4px 12px rgba(15,23,42,.10);

    /* Tipografia */
    --fs-xs:11px; --fs-sm:12px; --fs-md:13px; --fs-base:14px;
    --fs-lg:16px; --fs-xl:20px; --fs-2xl:26px;
    --fw-regular:400; --fw-medium:500; --fw-semibold:600; --fw-bold:700;

    /* Foco — anel único em todo o app */
    --ring:0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
    --ring-danger:0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent);

    /* Densidade */
    --row-h:40px; --control-h:34px;
}

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

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* Fundo com textura sutil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(232,114,42,.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 110%, rgba(30,45,74,.06) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   NAVBAR — Dark industrial (identidade Soluzcionar)
   ============================================================ */
.opus-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: var(--nav-float) 1.5rem 0;
}

.opus-navbar-inner {
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    display: flex;
    align-items: stretch;
    padding: 0 1.25rem;
    gap: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.28), 0 1px 0 rgba(255,255,255,.04) inset;
}

/* ---- Logo ---- */
.opus-logo {
    display: flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    flex-shrink: 0;
    padding-right: 1.25rem;
    transition: opacity .15s;
}
.opus-logo:hover { opacity: .85; }

.opus-logo-icon {
    width: 30px; height: 30px;
    background: var(--primary);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.opus-logo-text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .14em;
    color: #f8f8f2;
}

/* ---- Divisor ---- */
.opus-nav-divider {
    width: 1px;
    background: var(--nav-border);
    margin: 12px 1.1rem 12px 0;
    flex-shrink: 0;
}

/* ---- Links ---- */
.opus-nav-links {
    display: flex;
    align-items: stretch;
    flex: 1;
}

.opus-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 .85rem;
    font-size: .8rem;
    font-weight: 500;
    color: rgba(248,248,242,.75);
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* sobrepõe o border-bottom do inner */
}
.opus-nav-item:hover { color: #f8f8f2; }

/* Active: laranja + underline laranja */
a.opus-nav-item.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* ---- Direita ---- */
.opus-navbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    padding-left: 1rem;
}

/* Search button */
.opus-search-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: .38rem .9rem;
    color: rgba(248,248,242,.65);
    font-size: .78rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.opus-search-btn:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.14);
    color: rgba(248,248,242,.8);
}
.opus-search-btn i { font-size: .72rem; }
.opus-search-btn span { min-width: 100px; text-align: left; }
.opus-search-btn kbd {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 4px;
    padding: .05rem .35rem;
    font-size: .68rem;
    font-family: 'Inter', sans-serif;
    color: rgba(248,248,242,.45);
}

/* Icon button */
.opus-icon-btn {
    position: relative;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(248,248,242,.65);
    cursor: pointer;
    font-size: .82rem;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.opus-icon-btn:hover {
    background: rgba(255,255,255,.10);
    color: rgba(248,248,242,.85);
}

.opus-notif-dot {
    position: absolute;
    top: 7px; right: 7px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    border: 1.5px solid var(--nav-bg);
}

/* Avatar */
.opus-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--nav-bg), 0 0 0 3.5px var(--primary);
    transition: box-shadow .2s;
}
.opus-avatar:hover { box-shadow: 0 0 0 2px var(--nav-bg), 0 0 0 4px var(--primary-light); }

/* ============================================================
   DROPDOWN (Config submenu)
   ============================================================ */
.opus-dropdown {
    position: relative;
    display: flex;
    align-items: stretch;
}

.opus-dropdown-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .85rem;
    font-size: .8rem;
    font-weight: 500;
    color: rgba(248,248,242,.75);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s;
    font-family: 'Inter', sans-serif;
}
.opus-dropdown-trigger:hover { color: rgba(248,248,242,.85); }
.opus-dropdown-trigger.open {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

.opus-chevron {
    font-size: .58rem;
    transition: transform .2s;
    color: rgba(248,248,242,.45);
}
.opus-chevron.open { transform: rotate(180deg); color: var(--primary); }

.opus-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #21222c;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.08);
    border-top: 2px solid var(--primary);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
    min-width: 190px;
    z-index: 2000;
    overflow: hidden;
    animation: fadeDown .14s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.opus-dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    font-size: .8rem;
    font-weight: 500;
    color: rgba(248,248,242,.72);
    text-decoration: none;
    transition: background .12s, color .12s;
}
.opus-dropdown-item i { font-size: .78rem; width: 14px; text-align: center; }
.opus-dropdown-item:hover { background: rgba(255,255,255,.06); color: #f8f8f2; }
.opus-dropdown-item:hover i { color: var(--primary); }
.opus-dropdown-item.active { color: var(--primary); font-weight: 600; }

/* separador entre itens */
.opus-dropdown-item + .opus-dropdown-item {
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ============================================================
   MAIN
   ============================================================ */
.opus-main {
    position: relative;
    margin-top: calc(var(--nav-height) + var(--nav-float) + 1rem);
    padding: 0 2rem 1.75rem;
    min-height: calc(100vh - var(--nav-height) - var(--nav-float));
}

/* ============================================================
   DASHBOARD — CARDS
   ============================================================ */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.75rem 1.5rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    border: 1px solid rgba(255,255,255,.8);
}

.dash-card-value {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .35rem;
}
.dash-card-value.orange { color: var(--primary); }
.dash-card-value.green  { color: #22c55e; }
.dash-card-value.navy   { color: var(--navy); }
.dash-card-value.red    { color: #ef4444; }

.dash-card-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .09em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: .5rem;
}

.dash-card-trend {
    font-size: .78rem;
    font-weight: 500;
}
.dash-card-trend.up   { color: #22c55e; }
.dash-card-trend.down { color: #ef4444; }

/* ============================================================
   DASHBOARD — BOTTOM ROW
   ============================================================ */
.dash-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.dash-panel {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    border: 1px solid rgba(255,255,255,.8);
}

.dash-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.dash-table thead th {
    text-align: left;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.dash-table tbody td {
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-codigo { font-weight: 700; padding-right: .75rem; }

.badge-status {
    display: inline-block;
    padding: .22rem .7rem;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 600;
}
.badge-status.ativa  { background: #dcfce7; color: #16a34a; }
.badge-status.parada { background: #fef9c3; color: #ca8a04; }
.badge-status.planej { background: #ffe4d6; color: #c2410c; }

.perfil-badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}
.perfil-badge.admin      { background: #fde8e8; color: #c0392b; }
.perfil-badge.supervisor { background: #e8f4fd; color: #2471a3; }
.perfil-badge.operador   { background: #f0f2f5; color: #555; }

.chart-wrapper {
    height: 220px;
    position: relative;
}

/* ============================================================
   DASHBOARD — VISÃO DE EQUIPES
   ============================================================ */
.dash-visao-section { margin-bottom: 1.5rem; }

.dash-visao-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Grid de cards por tipo ── */
.dash-tipos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.dash-tipo-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 1rem 1.1rem .85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    border: 1px solid rgba(255,255,255,.8);
    border-top: 3px solid var(--tipo-cor, var(--primary));
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.dash-tipo-card-top {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.dash-tipo-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tipo-cor, var(--primary)) 12%, transparent);
    color: var(--tipo-cor, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.dash-tipo-card-info {
    min-width: 0;
}

.dash-tipo-card-nome {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-tipo-card-total {
    font-size: .68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: .05rem;
}

/* Barra de progresso (% em turno) */
.dash-tipo-card-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.dash-tipo-card-bar-fill {
    height: 100%;
    background: var(--tipo-cor, var(--primary));
    border-radius: 4px;
    transition: width .4s ease;
    min-width: 0;
}

.dash-tipo-card-footer {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .7rem;
    font-weight: 600;
}

.dtc-em-turno { color: #16a34a; }
.dtc-parada   { color: #94a3b8; }

.dash-tipo-card-us {
    font-size: .67rem;
    font-weight: 600;
    color: var(--primary);
    background: #fff3eb;
    padding: .12rem .45rem;
    border-radius: 7px;
    align-self: flex-start;
}

/* ── Tabela única de equipes ── */
.dash-equipes-full {
    padding: 0;
    overflow: hidden;
}

.dash-eq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.dash-eq-table thead th {
    text-align: left;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Linha separadora de grupo */
.eq-grupo-sep td {
    padding: .5rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.eq-grupo-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--tipo-cor, var(--primary));
    background: color-mix(in srgb, var(--tipo-cor, var(--primary)) 10%, transparent);
    padding: .18rem .65rem .18rem .45rem;
    border-radius: 20px;
    margin-right: .6rem;
}

.eq-grupo-count {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Linhas de equipe */
.dash-eq-table tbody tr:not(.eq-grupo-sep) td {
    padding: .65rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.dash-eq-table tbody tr:not(.eq-grupo-sep):last-child td { border-bottom: none; }
.dash-eq-table tbody tr.eq-row-ativa { background: #f0fdf4; }
.dash-eq-table tbody tr:not(.eq-grupo-sep):hover { background: #f8fafc; }
.dash-eq-table tbody tr.eq-row-ativa:hover { background: #dcfce7; }

.eq-nome {
    font-weight: 600;
    color: var(--text);
    font-size: .85rem;
}

.eq-placa {
    display: inline-block;
    margin-left: .45rem;
    font-size: .67rem;
    background: #f1f5f9;
    color: var(--text-muted);
    padding: .08rem .4rem;
    border-radius: 5px;
    font-weight: 500;
    letter-spacing: .04em;
}

.eq-badge-turno {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .7rem;
    font-weight: 600;
    background: #dcfce7;
    color: #16a34a;
    padding: .2rem .6rem;
    border-radius: 20px;
}

.eq-badge-parada {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .7rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #94a3b8;
    padding: .2rem .6rem;
    border-radius: 20px;
}

.eq-membros-count { font-size: .78rem; font-weight: 600; color: var(--navy); }
.eq-us            { font-size: .78rem; font-weight: 700; color: var(--primary); }
.eq-obras         { font-size: .78rem; font-weight: 600; color: #2563eb; }
.eq-base          { font-size: .78rem; color: var(--text-muted); }
.eq-dash          { color: var(--text-muted); font-size: .8rem; }

/* Tag de tipo nos turnos abertos */
.dash-tipo-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .67rem;
    font-weight: 600;
    color: var(--tipo-cor, var(--primary));
    background: color-mix(in srgb, var(--tipo-cor, var(--primary)) 10%, transparent);
    padding: .15rem .5rem;
    border-radius: 10px;
    margin-left: .4rem;
}

/* ============================================================
   DASHBOARD — JORNADAS ATIVAS
   ============================================================ */
.dash-jornadas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}
.dash-mapa-wrap {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    border: 1px solid rgba(255,255,255,.8);
    min-height: 420px;
    display: flex;
    flex-direction: column;
}
.dash-mapa-wrap .dash-panel-title {
    padding: 1.25rem 1.5rem .75rem;
    margin-bottom: 0;
}
#mapa-jornadas {
    flex: 1;
    min-height: 360px;
}
.dash-equipes-lista {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.dash-equipe-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid rgba(255,255,255,.8);
    border-left: 4px solid #22c55e;
}
.dash-equipe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.dash-equipe-nome {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
}
.dash-equipe-tempo {
    font-size: .75rem;
    font-weight: 600;
    color: #22c55e;
    background: #dcfce7;
    padding: .2rem .6rem;
    border-radius: 12px;
}
.dash-equipe-status-row {
    margin-bottom: .4rem;
}
.dash-status-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 10px;
}
.dash-status-badge.na-base {
    background: #dcfce7;
    color: #16a34a;
}
.dash-status-badge.em-transito {
    background: #fff7ed;
    color: #ea580c;
}
.dash-equipe-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .6rem;
}
.dash-equipe-membros {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.dash-membro-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #f1f5f9;
    padding: .2rem .55rem;
    border-radius: 10px;
    font-size: .7rem;
    color: var(--text);
}
.dash-membro-tag .funcao {
    color: var(--text-muted);
}
.dash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}
.dash-empty-state i {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    opacity: .4;
}
.dash-empty-state p {
    font-size: .9rem;
}

@media (max-width: 900px) {
    .dash-jornadas { grid-template-columns: 1fr; }
}

/* ============================================================
   PÁGINAS PLACEHOLDER
   ============================================================ */
/* ============================================================
   CONFIGURAÇÕES
   ============================================================ */
.cfg-page { display:flex; flex-direction:column; height:calc(100vh - var(--nav-height) - var(--nav-float) - 3.5rem); }
.cfg-tabs { display:flex; gap:0; border-bottom:2px solid #e2e8f0; padding:0 1.5rem; background:#fff; flex-shrink:0; }
.cfg-tab {
    display:inline-flex; align-items:center; gap:.45rem;
    padding:.7rem 1.1rem; font-size:.85rem; font-weight:600; color:#64748b;
    background:none; border:none; border-bottom:2px solid transparent; margin-bottom:-2px;
    cursor:pointer; transition:color .15s, border-color .15s;
}
.cfg-tab:hover { color:#1e2d4a; }
.cfg-tab-ativo { color:#e8722a !important; border-bottom-color:#e8722a !important; }
.cfg-body { flex:1; overflow-y:auto; padding:1.5rem; display:flex; flex-direction:column; gap:1rem; }
.cfg-aba-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.cfg-titulo { font-size:1.1rem; font-weight:800; color:#1e2d4a; margin:0; }
.cfg-subtitulo { font-size:.78rem; color:#94a3b8; margin:.1rem 0 0; }
.btn-importar-kit {
    display:inline-flex; align-items:center; gap:.4rem;
    background:#fff; border:1.5px solid #e2e8f0; color:#1e2d4a;
    font-size:.82rem; font-weight:600; padding:.4rem .9rem; border-radius:8px; cursor:pointer;
    transition:border-color .15s,background .15s;
}
.btn-importar-kit:hover { border-color:#e8722a; background:#fff3ed; color:#e8722a; }
.btn-novo-kit {
    display:inline-flex; align-items:center; gap:.4rem;
    background:#e8722a; color:#fff; font-size:.82rem; font-weight:600;
    padding:.4rem .9rem; border-radius:8px; border:none; cursor:pointer; transition:background .15s;
}
.btn-novo-kit:hover { background:#d4621a; }
.cfg-busca-wrap {
    display:flex; align-items:center; gap:.5rem;
    background:#f8fafc; border:1.5px solid #e2e8f0; border-radius:8px;
    padding:.4rem .75rem; max-width:440px;
}
.cfg-busca-wrap i { color:#94a3b8; font-size:.8rem; }
.cfg-busca { flex:1; border:none; background:none; outline:none; font-size:.85rem; color:#1e2d4a; }
.cfg-busca-clear { background:none; border:none; color:#94a3b8; cursor:pointer; padding:0; font-size:.75rem; }
.cfg-alerta {
    display:flex; align-items:center; gap:.6rem;
    padding:.6rem 1rem; border-radius:8px; font-size:.83rem; font-weight:500;
}
.cfg-alerta-ok  { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.cfg-alerta-erro{ background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }
.cfg-loading { padding:1rem; color:#94a3b8; font-size:.85rem; display:flex; align-items:center; gap:.5rem; }
.cfg-table-wrap { overflow-x:auto; border:1px solid #e2e8f0; border-radius:10px; }
.cfg-table { width:100%; border-collapse:collapse; font-size:.83rem; }
.cfg-table thead th {
    background:#f8fafc; color:#64748b; font-weight:700; font-size:.75rem;
    text-transform:uppercase; letter-spacing:.03em;
    padding:.55rem .9rem; border-bottom:1px solid #e2e8f0; text-align:left; white-space:nowrap;
}
.cfg-table tbody tr { border-bottom:1px solid #f1f5f9; transition:background .1s; }
.cfg-table tbody tr:hover { background:#fafafa; }
.cfg-table tbody tr:last-child { border-bottom:none; }
.cfg-table tbody td { padding:.55rem .9rem; color:#334155; vertical-align:middle; }
.cfg-tr-ativo { background:#fff8f5 !important; }
.cfg-td-code { font-family:monospace; font-size:.8rem; color:#e8722a; font-weight:600; }
.cfg-btn-itens {
    background:none; border:1px solid #e2e8f0; border-radius:6px;
    padding:.2rem .45rem; cursor:pointer; color:#64748b; font-size:.75rem; transition:all .15s;
}
.cfg-btn-itens:hover { border-color:#e8722a; color:#e8722a; background:#fff3ed; }
.cfg-btn-acao {
    display:inline-flex; align-items:center; justify-content:center;
    width:26px; height:26px; border-radius:6px; border:1px solid #e2e8f0;
    background:#fff; cursor:pointer; font-size:.72rem; transition:all .15s;
}
.cfg-btn-edit:hover { border-color:#3b82f6; color:#3b82f6; background:#eff6ff; }
.cfg-btn-del:hover  { border-color:#ef4444; color:#ef4444; background:#fef2f2; }
.cfg-tr-expand td { padding:0 !important; background:#fafcff; }
.cfg-itens-panel { padding:.75rem 1rem; }
.cfg-itens-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:.6rem; font-size:.82rem; color:#475569; }
.cfg-btn-novo-item {
    display:inline-flex; align-items:center; gap:.3rem;
    background:#1e2d4a; color:#fff; border:none; border-radius:6px;
    font-size:.75rem; font-weight:600; padding:.3rem .65rem; cursor:pointer; transition:background .15s;
}
.cfg-btn-novo-item:hover { background:#e8722a; }
.cfg-table-itens { background:#fff; border-radius:8px; border:1px solid #e2e8f0; }
.cfg-badge { display:inline-block; padding:.1rem .4rem; border-radius:4px; font-size:.7rem; font-weight:700; }
.cfg-badge-mat      { background:#dbeafe; color:#1d4ed8; }
.cfg-badge-serv     { background:#dcfce7; color:#16a34a; }
.cfg-badge-instalar { background:#14532d; color:#4ade80; }
.cfg-badge-retirar  { background:#4c1d95; color:#c4b5fd; }
.cfg-paginacao { display:flex; align-items:center; gap:.75rem; justify-content:center; padding:.5rem; }
.cfg-pag-btn {
    background:#fff; border:1px solid #e2e8f0; border-radius:6px;
    padding:.3rem .65rem; cursor:pointer; color:#475569; transition:all .15s;
}
.cfg-pag-btn:hover:not(:disabled) { border-color:#e8722a; color:#e8722a; }
.cfg-pag-btn:disabled { opacity:.4; cursor:default; }
.cfg-pag-info { font-size:.8rem; color:#64748b; }

.cfg-tr-clicavel { cursor:pointer; }
.cfg-badge-count {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:24px; height:20px; padding:0 6px;
    background:#f1f5f9; color:#475569;
    border-radius:10px; font-size:.72rem; font-weight:700;
}

/* ── Detalhe do kit ── */
.cfg-kit-header {
    display:flex; align-items:center; gap:.75rem;
    padding:.75rem 1rem;
    background:#fff; border:1px solid #e2e8f0; border-radius:10px;
    flex-shrink:0;
}
.cfg-kit-back {
    width:32px; height:32px; border-radius:8px;
    border:1px solid #e2e8f0; background:none;
    display:flex; align-items:center; justify-content:center;
    color:#64748b; cursor:pointer; font-size:.85rem; flex-shrink:0;
    transition:all .15s;
}
.cfg-kit-back:hover { border-color:#e8722a; color:#e8722a; background:#fff3ed; }
.cfg-kit-header-info { display:flex; align-items:baseline; gap:.6rem; min-width:0; }
.cfg-kit-header-desc { font-size:.88rem; color:#475569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cfg-btn-editar-kit { width:auto !important; height:auto !important; padding:.35rem .75rem; font-size:.78rem; gap:.35rem; white-space:nowrap; color:#64748b; }

.page-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--text-muted);
}
.placeholder-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}
.page-placeholder h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .5rem;
}

/* ============================================================
   BASES PAGE
   ============================================================ */
.bases-page { max-width: 100%; }

.bases-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.bases-titulo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .2rem;
}
.bases-subtitulo { font-size: .875rem; color: var(--text-muted); }

.btn-nova-base {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-nova-base:hover { background: var(--primary-light); transform: translateY(-1px); }

.bases-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    gap: .75rem;
}
.bases-vazio i { font-size: 2.5rem; color: #ddd; }
.bases-vazio p { font-size: .95rem; }

.coord-cell { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.acoes-cell { width: 80px; text-align: right; white-space: nowrap; }
.btn-acao {
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: .3rem .5rem;
    font-size: .72rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .12s, color .12s, border-color .12s;
}
.btn-acao.editar:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.btn-acao.excluir:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-acao.cobertura:hover { background: #fff5ef; color: var(--primary); border-color: #fdd0b3; }

/* ---- Drawer lateral ---- */
.drawer-overlay {
    position: fixed;
    top: calc(var(--nav-height) + var(--nav-float));
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.35);
    z-index: 3000;
    backdrop-filter: blur(2px);
}
.drawer-panel {
    position: fixed;
    top: calc(var(--nav-height) + var(--nav-float));
    right: 0; bottom: 0;
    width: 420px;
    background: var(--card-bg);
    z-index: 3001;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    animation: slideInRight .22s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.drawer-fechar {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .9rem;
    cursor: pointer;
    padding: .25rem .4rem;
    border-radius: 6px;
    transition: background .12s;
}
.drawer-fechar:hover { background: var(--bg); }

.drawer-body { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.drawer-footer {
    display: flex;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* Form elements */
.form-grupo { display: flex; flex-direction: column; gap: .45rem; }
.form-grupo label { font-size: .8rem; font-weight: 600; color: var(--text); }
.obrigatorio { color: var(--primary); }

.form-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .6rem .85rem;
    font-family: 'Inter', sans-serif;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,114,42,.12);
}

.coords-row { display: flex; gap: .75rem; }
.coords-input { flex: 1; position: relative; }
.coords-label {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}
.coords-input .form-input { padding-left: 2rem; }

.btn-mapa-picker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: none;
    border: 1px dashed var(--primary);
    border-radius: 8px;
    padding: .5rem .85rem;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: .25rem;
    transition: background .15s;
}
.btn-mapa-picker:hover { background: rgba(232,114,42,.06); }

.form-erro {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: .65rem .85rem;
    font-size: .82rem;
    color: #dc2626;
}
.form-aviso-restrito {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: .6rem .8rem;
    font-size: .8rem;
    color: #92400e;
    margin-bottom: .75rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.form-aviso-restrito i { color: #d97706; margin-top: 2px; }

.btn-salvar {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .6rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s;
}
.btn-salvar:hover:not(:disabled) { background: var(--primary-light); }
.btn-salvar:disabled { opacity: .6; cursor: default; }

.btn-cancelar {
    background: none;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s;
}
.btn-cancelar:hover { background: var(--bg); }

.btn-excluir-confirm {
    background: #ef4444;
    border: none;
    border-radius: 9px;
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.btn-excluir-confirm:hover { background: #dc2626; }

/* ---- Variantes semânticas para .btn-salvar e .btn-nova-base ---- */
.btn-salvar.danger,
.btn-nova-base.danger    { background: var(--danger); }
.btn-salvar.danger:hover:not(:disabled),
.btn-nova-base.danger:hover { background: var(--danger-light); }

.btn-salvar.success,
.btn-nova-base.success   { background: var(--success); }
.btn-salvar.success:hover:not(:disabled),
.btn-nova-base.success:hover { background: var(--success-light); }

.btn-salvar.warning,
.btn-nova-base.warning   { background: var(--warning); }
.btn-salvar.warning:hover:not(:disabled),
.btn-nova-base.warning:hover { background: var(--warning-light); }

.btn-salvar.info,
.btn-nova-base.info      { background: var(--info); }
.btn-salvar.info:hover:not(:disabled),
.btn-nova-base.info:hover { background: var(--info-light); }

/* ---- Variantes para .btn-acao (botões de ação inline em tabelas) ---- */
.btn-acao.acao-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}
.btn-acao.acao-info:hover { background: var(--info-border); color: var(--info); }

.btn-acao.acao-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}
.btn-acao.acao-success:hover { background: var(--success-border); color: var(--success); }

/* ---- Variantes para .btn-table-action (botões dentro de células de tabela) ---- */
.btn-table-action.danger { background: var(--danger); color: #fff; }
.btn-table-action.danger:hover { background: var(--danger-light); }

/* ---- Alertas inline reutilizáveis (substituem styles inline) ---- */
.alert-inline {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .75rem 1.5rem;
    padding: .65rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: .88rem;
}
.alert-inline .alert-close {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    font-size: .85rem;
}
.alert-inline.alert-erro {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}
.alert-inline.alert-erro .alert-close { color: var(--danger); }
.alert-inline.alert-sucesso {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #166534;
}
.alert-inline.alert-sucesso .alert-close { color: #166534; }

/* ---- Loader inline padronizado (centralizado em painéis) ---- */
.loader-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 3rem;
    color: #64748b;
    font-size: .9rem;
}

/* ---- Loader sobre mapas / fundos escuros (Telemetria, Mapa) ---- */
.loader-overlay-dark {
    position: absolute;
    inset: 0;
    z-index: 2000;
    background: rgba(28,28,36,.75);
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-overlay-dark-card {
    background: #1c1c24;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.loader-overlay-dark-card .loader-overlay-dark-title {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: .25rem;
}
.loader-overlay-dark-card .loader-overlay-dark-sub {
    color: rgba(255,255,255,.45);
    font-size: .8rem;
}

/* ---- Modal genérico ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 92vh;
    width: 760px;
    max-width: 95vw;
}
.modal-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
/* Modais arrastáveis (data-draggable=true): cursor de movimento no header. */
.modal-card[data-draggable="true"] > .modal-header {
    cursor: move;
    user-select: none;
}

/* Modal flutuante: sem escurecer o fundo, cliques atravessam o overlay e
   atingem a tela atrás. Só o card recebe interação. Z-index alto pra ficar
   acima dos elementos do fundo. */
.modal-overlay--floating {
    background: transparent !important;
    pointer-events: none;
}
.modal-overlay--floating .modal-card {
    pointer-events: auto;
    z-index: 1100;
    box-shadow: 0 14px 48px rgba(15, 23, 42, .35),
                0 4px 12px rgba(15, 23, 42, .15);
}
.modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #1e2d4a; flex: 1; }
.modal-close {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 1rem; padding: .25rem;
    border-radius: 4px; line-height: 1;
}
.modal-close:hover { color: #475569; background: #f1f5f9; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* ---- Modal do Mapa ---- */
.mapa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mapa-modal-container {
    background: var(--card-bg);
    border-radius: 16px;
    width: min(920px, 96vw);
    height: min(620px, 92vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
    animation: fadeScaleIn .2s ease;
}
@keyframes fadeScaleIn {
    from { opacity: 0; transform: scale(.97); }
    to   { opacity: 1; transform: scale(1); }
}

.mapa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}
.mapa-modal-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .9rem;
    cursor: pointer;
    padding: .25rem .4rem;
    border-radius: 6px;
    transition: background .12s;
}
.mapa-modal-header button:hover { background: var(--bg); }

/* Barra de busca do mapa */
.mapa-busca-bar {
    display: flex;
    gap: .6rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.mapa-busca-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.mapa-busca-input-wrap i {
    position: absolute;
    left: .75rem;
    color: var(--text-muted);
    font-size: .78rem;
    pointer-events: none;
}
.mapa-busca-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .55rem .85rem .55rem 2.1rem;
    font-family: 'Inter', sans-serif;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.mapa-busca-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,114,42,.12);
}
.btn-buscar {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.btn-buscar:hover:not(:disabled) { background: var(--primary-light); }
.btn-buscar:disabled { opacity: .65; cursor: default; }

.mapa-busca-erro {
    padding: .4rem 1.25rem;
    font-size: .78rem;
    color: #dc2626;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
}

/* Sugestões de autocomplete */
.sugestoes-lista {
    border-bottom: 1px solid var(--border);
    background: #fff;
    max-height: 200px;
    overflow-y: auto;
}
.sugestao-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1.25rem;
    font-size: .85rem;
    color: var(--text);
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background .1s;
    font-family: 'Inter', sans-serif;
}
.sugestao-item:first-child { border-top: none; }
.sugestao-item:hover { background: #fff8f5; }
.sugestao-item i { color: var(--primary); font-size: .75rem; flex-shrink: 0; }

#mapa-seletor, #mapa-canteiro-seletor { flex: 1; z-index: 1; }
#mapa-cobertura { flex: 1; z-index: 1; min-height: 420px; }

.mapa-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--border);
    min-height: 56px;
}
.mapa-hint { font-size: .82rem; color: var(--text-muted); }
.coord-preview {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* ---- Municípios checklist ---- */
.mun-busca-wrap {
    position: relative;
    margin-bottom: .5rem;
}
.mun-busca-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: .8rem;
    pointer-events: none;
}
.mun-busca-input { padding-left: 2rem !important; }

.municipios-checklist {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    padding: .25rem 0;
}
.municipio-check-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .9rem;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
    transition: background .1s;
    border-radius: 6px;
    user-select: none;
}
.municipio-check-item:hover { background: #f0f2f5; }
.municipio-check-item.selecionado { background: #fff5ef; color: var(--primary); font-weight: 500; }
.municipio-check-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.municipio-check-item.em-uso {
    opacity: .55;
    cursor: not-allowed;
}
.municipio-check-item.em-uso:hover { background: transparent; }
.municipio-check-item.em-uso input[type="checkbox"] { cursor: not-allowed; }
.mun-nome { flex: 1; }
.mun-em-uso-hint {
    font-size: .72rem;
    color: #888;
    background: #f0f2f5;
    border-radius: 4px;
    padding: .1rem .4rem;
    white-space: nowrap;
}
.mun-selecionados-count {
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ---- Badge municípios na tabela ---- */
.mun-badge {
    display: inline-block;
    background: #fff5ef;
    color: var(--primary);
    border: 1px solid #fdd0b3;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 500;
}
.mun-nenhum { color: #bbb; }

/* ---- Modal de cobertura ---- */
.cobertura-container { width: min(92vw, 860px); }
.cobertura-loading {
    padding: .6rem 1.25rem;
    font-size: .83rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.cobertura-legenda {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    font-size: .82rem;
    color: #666;
}
.legenda-base { color: var(--primary); font-weight: 500; }
.legenda-base i { margin-right: .2rem; }
.legenda-mun {
    display: inline-block;
    width: 14px; height: 14px;
    background: rgba(232,114,42,.25);
    border: 2px solid #e8722a;
    border-radius: 3px;
    vertical-align: middle;
}
.legenda-count { color: #888; }

/* ============================================================
   BLAZOR ERROR UI
   ============================================================ */
#blazor-error-ui {
    background: #b32121;
    bottom: 0; left: 0; right: 0;
    padding: .75rem 1.25rem;
    color: white;
    display: none;
    position: fixed;
    z-index: 9999;
}
#blazor-error-ui .reload { color: #ffd; margin-left: .5rem; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
/* Reconnect modal — oculto por padrão, Blazor adiciona classes para mostrar */
#components-reconnect-modal { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15,15,20,.65);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.opus-reconnect-card {
    background: #1c1c24;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 280px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
    text-align: center;
}
.opus-reconnect-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232,114,42,.25);
    border-top-color: #e8722a;
    border-radius: 50%;
    animation: opus-spin 1s linear infinite;
}
.opus-reconnect-title { color: #fff; font-weight: 600; font-size: 1rem; margin-bottom: .25rem; }
.opus-reconnect-sub   { color: rgba(255,255,255,.45); font-size: .8rem; }
@keyframes opus-spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1024px) {
    .opus-navbar { padding: 8px 12px 0; }
    .opus-navbar-inner { border-radius: 12px; }
    .dash-cards { grid-template-columns: repeat(2, 1fr); }
    .dash-bottom { grid-template-columns: 1fr; }
    .opus-search-btn span, .opus-search-btn kbd { display: none; }
}

@media (max-width: 640px) {
    .dash-cards { grid-template-columns: 1fr 1fr; }
    .opus-nav-links { display: none; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1c26 0%, #282a36 60%, #1e2d4a 100%);
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .4rem;
}

.login-logo .logo-mark {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
}

.login-logo .logo-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e2d4a;
    letter-spacing: .03em;
}

.login-subtitulo {
    font-size: .88rem;
    color: #888;
    margin-bottom: 2rem;
}

.login-campo {
    margin-bottom: 1.1rem;
}

.login-campo label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: .35rem;
}

.login-campo .form-input {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid #dde1ea;
    border-radius: 9px;
    font-size: .95rem;
    background: #f8f9fc;
    color: #1e2d4a;
    transition: border-color .15s;
    box-sizing: border-box;
}

.login-campo .form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.login-erro {
    background: #fff0ed;
    border: 1px solid #f3bdb3;
    color: #c0392b;
    border-radius: 8px;
    padding: .6rem .9rem;
    font-size: .84rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.login-btn {
    width: 100%;
    padding: .75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: .5rem;
    transition: background .15s, opacity .15s;
}

.login-btn:hover { background: #d46520; }
.login-btn:disabled { opacity: .65; cursor: not-allowed; }

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: .74rem;
    color: #9ca3af;
    line-height: 1.6;
}
.login-footer strong { color: #6b7280; }

.opus-footer {
    text-align: center;
    padding: .55rem 1rem;
    font-size: .72rem;
    color: #9ca3af;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.opus-footer strong { color: #6b7280; }

/* ============================================================
   EQUIPES
   ============================================================ */

/* Stats no header */
.eq-page-header {
    margin-bottom: 1.5rem;
}

.eq-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.eq-stats {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.eq-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #f0f2f5;
    border: 1px solid #e2e6ea;
    border-radius: 20px;
    padding: .25rem .75rem;
    font-size: .8rem;
    color: #555;
    font-weight: 500;
}

.eq-stat-badge.ativa  { background: #eafaf1; border-color: #a9dfbf; color: #27ae60; }
.eq-stat-badge.cap    { background: #fef9e7; border-color: #f9e3a3; color: #b7770d; }

/* Filtros */
.eq-filtros {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.eq-filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.eq-filtro-grupo label {
    font-size: .75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Tabela de equipes */
.eq-table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 1.25rem;
    overflow-x: auto;
}

.eq-table-wrap .dash-table thead th {
    padding: 1rem 0 .75rem;
}

.eq-table-wrap .dash-table tbody td {
    padding: .7rem 0;
}

.eq-table-wrap .dash-table tbody tr {
    transition: background .1s;
}

.eq-table-wrap .dash-table tbody tr:hover {
    background: #fafbfc;
}

.eq-nome-cell {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.eq-cell-icon {
    width: 30px;
    height: 30px;
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--primary);
    flex-shrink: 0;
}

.eq-muted { color: var(--text-muted); font-size: .875rem; }

.eq-num {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: .875rem;
}

.eq-status-dot {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: #555;
}

.eq-row-inativa td { opacity: .5; }

.eq-supervisor-cell {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.eq-membro-avatar.sm {
    width: 24px;
    height: 24px;
    font-size: .65rem;
}

/* Modal sections */
.eq-modal-section {
    margin-bottom: 1.25rem;
}

.eq-modal-section:last-child { margin-bottom: 0; }

.eq-modal-section h3 {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* Card individual */
.eq-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    padding: .75rem .9rem .7rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: box-shadow .15s;
}

.eq-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.09); }
.eq-card.inativa { opacity: .65; }

.eq-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.eq-card-icon {
    width: 32px;
    height: 32px;
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    color: var(--primary);
    flex-shrink: 0;
}

.eq-card-nome {
    flex: 1;
    font-weight: 700;
    font-size: .875rem;
    color: #1e2d4a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eq-card-menu {
    display: flex;
    gap: .3rem;
    opacity: 0;
    transition: opacity .15s;
}

.eq-card:hover .eq-card-menu { opacity: 1; }

.eq-card-status {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: #666;
}

.eq-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.eq-dot.ativa   { background: #27ae60; }
.eq-dot.inativa { background: #bbb; }

.eq-card-info {
    font-size: .78rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.eq-card-info i { color: #aaa; width: 13px; text-align: center; flex-shrink: 0; }

.eq-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: .5rem;
    border-top: 1px solid #f0f2f5;
}

.eq-membros-btn {
    background: none;
    border: 1.5px solid #e0e4eb;
    border-radius: 20px;
    padding: .2rem .6rem;
    font-size: .72rem;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .3rem;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
}
.eq-membros-btn:hover { background: #f5f7fa; border-color: #c5cbd5; }

/* Tipo badges */
.eq-tipo-badge {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .2rem .55rem;
    border-radius: 5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.eq-tipo-badge.pesada           { background: #fde8e8; color: #c0392b; }
.eq-tipo-badge.implantacao      { background: #e8f4fd; color: #2980b9; }
.eq-tipo-badge.leve-apoio       { background: #eafaf1; color: #27ae60; }
.eq-tipo-badge.leve-lancamento  { background: #e8f8f0; color: #1a8a52; }
.eq-tipo-badge.poda             { background: #eafaf1; color: #1e8449; }
.eq-tipo-badge.cesto-aereo      { background: #fef0e6; color: #e67e22; }
.eq-tipo-badge.retroescavadeira { background: #f5eef8; color: #8e44ad; }
.eq-tipo-badge.linha-viva       { background: #fdf6e3; color: #d4a017; }

/* ── Modal Membros ── */
.eq-modal {
    background: #fff;
    border-radius: 16px;
    width: 780px;
    max-width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.eq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.eq-modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e2d4a;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

.eq-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    flex: 1;
}

.eq-modal-col {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    max-height: 55vh;
}

.eq-modal-col:first-child {
    border-right: 1px solid #eee;
}

.eq-modal-col h3 {
    font-size: .85rem;
    font-weight: 600;
    color: #444;
    margin: 0 0 .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.eq-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

/* Itens de membro */
.eq-membro-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border: 1px solid #f0f2f5;
    border-radius: 10px;
    margin-bottom: .5rem;
    background: #fafbfc;
    transition: background .12s;
}
.eq-membro-item:hover { background: #f0f4f8; }
.eq-membro-item.disponivel { background: #f8fffe; border-color: #d4eee8; }
.eq-membro-item.em-outra { background: #fffbeb; border-color: #fcd34d; }
.eq-membro-em-equipe {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: .7rem;
    color: #92400e;
    background: #fef3c7;
    padding: 1px 7px;
    border-radius: 10px;
    width: max-content;
}
.eq-membro-em-equipe i { font-size: .62rem; }

.eq-membro-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8eaf0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: #555;
    flex-shrink: 0;
}

.eq-membro-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.eq-membro-nome {
    font-size: .88rem;
    font-weight: 600;
    color: #1e2d4a;
}

.eq-membro-funcao {
    font-size: .75rem;
    color: #888;
}

.eq-empty-membros {
    font-size: .85rem;
    color: #aaa;
    text-align: center;
    padding: 1.5rem 0;
}

/* Add / remove buttons */
.eq-btn-add {
    width: 28px; height: 28px;
    border-radius: 7px;
    border: 1.5px solid #27ae60;
    background: #eafaf1;
    color: #27ae60;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    transition: background .12s;
    flex-shrink: 0;
}
.eq-btn-add:hover { background: #27ae60; color: #fff; }

.eq-btn-remove {
    width: 28px; height: 28px;
    border-radius: 7px;
    border: 1.5px solid #e74c3c;
    background: #fdf0ed;
    color: #e74c3c;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    transition: background .12s;
    flex-shrink: 0;
}
.eq-btn-remove:hover { background: #e74c3c; color: #fff; }

/* Responsive */
@media (max-width: 1400px) {
    .eq-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
    .eq-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .eq-filtros { grid-template-columns: 1fr 1fr; }
    .eq-grid { grid-template-columns: repeat(2, 1fr); }
    .eq-modal-body { grid-template-columns: 1fr; }
    .eq-modal-col:first-child { border-right: none; border-bottom: 1px solid #eee; }
}
@media (max-width: 560px) {
    .eq-filtros { grid-template-columns: 1fr; }
    .eq-grid { grid-template-columns: 1fr; }
}

/* ── Confirm modal ── */
.confirm-modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem 2rem;
    width: min(420px, 92vw);
    box-shadow: 0 16px 48px rgba(0,0,0,.22);
}
.confirm-modal p { font-size: .95rem; color: #333; margin: 0; }

.btn-excluir {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.25rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-excluir:hover { background: #c0392b; }

/* ── Importar ── */
.form-sucesso {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.import-erros-lista {
    font-size: .82rem;
    color: #991b1b;
    padding-left: 1.2rem;
    margin: .5rem 0 1rem;
}
.import-preview { margin-top: 1.25rem; }
.import-preview-info { font-size: .88rem; color: #555; margin-bottom: .5rem; }
.import-table-wrap { overflow-x: auto; }
.import-mais { font-size: .82rem; color: #888; margin-top: .5rem; text-align: center; }
.badge-import-status {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Import cards ── */
.import-secao-titulo {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #888;
    text-transform: uppercase;
    margin: 0 0 .75rem;
}
.import-cards { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.import-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 320px;
    transition: border-color .15s, box-shadow .15s;
}
.import-card.ativo { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,114,42,.12); }
.import-card-icone {
    width: 44px; height: 44px;
    background: #f0fdf4;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #16a34a;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.import-card-info { flex: 1; }
.import-card-info strong { display: block; font-size: .9rem; color: #111; }
.import-card-info span { font-size: .8rem; color: #888; }
.btn-importar-card {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.btn-importar-card:hover { background: var(--orange-dark, #c9611a); }

/* ── Import preview / drawer ── */
.import-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    gap: .5rem;
}
.import-preview-nome { font-size: .88rem; color: #333; }
.import-preview-nome i { color: #16a34a; margin-right: .35rem; }
.import-preview-count {
    font-size: .8rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    padding: 2px 10px;
}
.import-carregando { font-size: .88rem; color: #888; margin: .75rem 0; }
.import-vazio      { font-size: .88rem; color: #aaa; margin: .5rem 0; }
.import-mais       { font-size: .8rem; color: #aaa; text-align: center; margin-top: .5rem; }

/* ── Import stats badges ── */
.import-stat {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 10px;
    min-width: 30px;
    text-align: center;
}
.import-stat.inseridos  { background: #f0fdf4; color: #166534; }
.import-stat.atualizados { background: #eff6ff; color: #1e40af; }
.import-stat.erros      { background: #fef2f2; color: #991b1b; }
.import-stat.zero       { background: #f1f5f9; color: #94a3b8; }

.import-log-arquivo {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82rem;
    color: #555;
}

/* ── Import error modal ── */
.import-erros-pre {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .75rem;
    font-size: .8rem;
    color: #991b1b;
    white-space: pre-wrap;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
}

/* ── Import history table ── */
.import-hist-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.import-hist-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .875rem;
}
.import-hist-table thead tr {
    background: #f8f9fb;
    border-bottom: 1.5px solid #e5e7eb;
}
.import-hist-table th {
    padding: .7rem 1rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: #94a3b8;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.import-hist-table th.num,
.import-hist-table td.num { text-align: center; }
.import-hist-table th.ctr,
.import-hist-table td.ctr { text-align: center; }
.import-hist-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}
.import-hist-table tbody tr:last-child { border-bottom: none; }
.import-hist-table tbody tr:hover { background: #fafbfc; }
.import-hist-table td { padding: .75rem 1rem; vertical-align: middle; color: #334155; }

.import-hist-data { white-space: nowrap; }
.import-hist-dia  { display: block; font-weight: 600; font-size: .85rem; color: #1e293b; }
.import-hist-hora { display: block; font-size: .75rem; color: #94a3b8; margin-top: 1px; }

.import-hist-tipo { font-weight: 500; color: #1e293b; }

.import-hist-arquivo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: .82rem;
}
.import-hist-arquivo i { color: #16a34a; margin-right: .3rem; }

.import-hist-usuario { color: #475569; }

/* ── Obras ── */
.obras-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.obras-hero-copy {
    background:
        radial-gradient(circle at 86% 16%, rgba(232,114,42,.16), transparent 22%),
        radial-gradient(circle at 10% 0%, rgba(255,255,255,.04), transparent 28%),
        linear-gradient(135deg, #2a2c37 0%, #273246 46%, #232a39 100%);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 20px;
    padding: 1.35rem 1.4rem;
    box-shadow:
        0 12px 28px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.04);
}

.obras-hero-overline {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(226,232,240,.66);
    font-weight: 800;
    margin-bottom: .35rem;
}

.obras-hero-headline {
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.15;
    color: #fff;
    max-width: 24ch;
}

.obras-hero-subline {
    margin-top: .7rem;
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    color: rgba(226,232,240,.8);
    font-size: .82rem;
    font-weight: 600;
}

.obras-alerts {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.obras-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: .42rem .75rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
}

.obras-alert-chip-danger { background: rgba(239,68,68,.16); color: #fecaca; }
.obras-alert-chip-danger-soft { background: rgba(251,113,133,.14); color: #fecdd3; }
.obras-alert-chip-warn { background: rgba(245,158,11,.18); color: #fde68a; }
.obras-alert-chip-primary { background: rgba(59,130,246,.18); color: #bfdbfe; }
.obras-alert-chip-neutral { background: rgba(255,255,255,.1); color: rgba(255,255,255,.86); }

.obras-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}
.obras-stat-card {
    background: #fff;
    border: 1px solid #e6edf7;
    border-radius: 18px;
    padding: 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 110px;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.obras-stat-card-strong {
    background: linear-gradient(180deg, #fffaf6 0%, #fff 100%);
    border-color: #f4d6c0;
}
.obras-stat-num {
    font-size: 1.9rem;
    font-weight: 900;
    color: #1f2a44;
    line-height: 1.05;
    letter-spacing: -.03em;
}
.obras-stat-label {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: .45rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.obras-stat-meta {
    font-size: .76rem;
    color: #64748b;
    margin-top: .2rem;
    font-weight: 600;
}

.obras-filtros-shell {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e7edf6;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.obras-filtro-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .8rem;
}

.obras-filtro-title {
    font-size: .9rem;
    font-weight: 800;
    color: #1f2a44;
}

.obras-filtro-note {
    font-size: .76rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.obras-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.obras-busca-wrap {
    flex: 1;
    min-width: 260px;
    margin-bottom: 0 !important;
}
.obras-select {
    max-width: 200px;
    height: 42px;
    padding: 0 .75rem;
    font-size: .85rem;
}

.obras-btn-limpar {
    height: 42px;
    border-radius: 10px;
}

.obras-table-shell {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e8eef6;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
}

.obras-table-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.2rem .7rem;
}

.obras-table-title {
    font-size: .95rem;
    font-weight: 800;
    color: #1f2a44;
}

.obras-table-note {
    font-size: .75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* Tabela */
.obras-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    /* sem table-layout: fixed — colunas se ajustam ao conteúdo */
}
.obras-table thead tr {
    background: #f8fafc;
    border-bottom: 1.5px solid #e5e7eb;
}
.obras-table th {
    padding: .8rem 1rem;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #94a3b8;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.obras-table th.num { text-align: right; }
.obras-table td { padding: .9rem 1rem; vertical-align: middle; color: #334155; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.obras-table tbody tr:last-child td { border-bottom: none; }
.obras-table tbody tr:hover { background: #fff8f4; }
.obras-table td.num { text-align: right; }
/* Status pode quebrar linha para não distorcer */
.obras-table td.obras-status-cell { white-space: normal; min-width: 100px; max-width: 170px; }

.obras-codigo { font-weight: 800; font-size: 1rem; color: var(--navy); }
.obras-tipo   { font-size: .88rem; color: #64748b; font-weight: 600; }
.obras-num    { font-variant-numeric: tabular-nums; }
.obras-data   { font-size: .8rem; color: #64748b; }

.obras-prazo-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .12rem;
}

.obras-prazo-data {
    font-size: .82rem;
    font-weight: 800;
    color: #1f2a44;
}

.obras-prazo-meta {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.obras-prazo-danger .obras-prazo-data,
.obras-prazo-danger .obras-prazo-meta { color: #dc2626; }
.obras-prazo-warn .obras-prazo-data,
.obras-prazo-warn .obras-prazo-meta { color: #d97706; }
.obras-prazo-ok .obras-prazo-data,
.obras-prazo-ok .obras-prazo-meta { color: #16a34a; }
.obras-prazo-empty .obras-prazo-data,
.obras-prazo-empty .obras-prazo-meta { color: #94a3b8; }

.obras-lote-date {
    display: inline-block;
    font-size: .82rem;
    font-weight: 800;
}

.obras-lote-danger { color: #b45309; }
.obras-lote-warn { color: #d97706; }
.obras-lote-ok { color: #64748b; }
.obras-lote-empty { color: #94a3b8; }

.obras-prio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    padding: 0 .55rem;
    text-align: center;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 900;
}
.obras-prio-top { background: #fef2f2; color: #dc2626; }
.obras-prio-mid { background: #fff7ed; color: #d97706; }
.obras-prio-low { background: #eff6ff; color: #2563eb; }

.obras-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #f8fafc;
    color: #94a3b8;
    transition: all .15s ease;
}

.obras-row-link:hover .obras-row-action {
    background: #fff;
    color: #d4621a;
}

/* Status badges */
.obras-status-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.obras-status-badge.st-orcamento  { background: #fffbeb; color: #92400e; }
.obras-status-badge.st-construcao { background: #f0fdf4; color: #166534; }
.obras-status-badge.st-outro      { background: #f1f5f9; color: #475569; }

.obras-footer {
    padding: .65rem 1rem;
    font-size: .8rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

@media (max-width: 1100px) {
    .obras-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .obras-stats {
        grid-template-columns: 1fr 1fr;
    }
    .obras-filtro-topline,
    .obras-table-topline {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Mapa de Rotas ─────────────────────────────────────────────────────────── */

.mapa-container {
    display: flex;
    /* Cancela o padding do .opus-main (1.75rem top/bottom, 2rem sides) */
    margin: -1.75rem -2rem;
    height: calc(100vh - var(--nav-height) - var(--nav-float) - 1rem);
    overflow: hidden;
}

.mapa-area {
    flex: 1;
    position: relative;
    min-width: 0;
}
#mapa-rotas {
    width: 100%;
    height: calc(100vh - var(--nav-height) - var(--nav-float) - 1rem);
}

/* Sidebar direita */
.mapa-sidebar {
    width: 380px;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
    background: #f8fafc;
    overflow: hidden;
}

.mapa-sidebar-loading {
    padding: 2rem;
    text-align: center;
    color: #64748b;
}

.mapa-sidebar-header {
    padding: 1rem 1.25rem .5rem;
}
.mapa-sidebar-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: #1e2d4a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.mapa-sidebar-titulo i { color: #e8722a; }
.mapa-sidebar-sub {
    font-size: .78rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* Seletor de base */
.mapa-filtro-base {
    padding: 0 1.25rem .75rem;
}
.mapa-filtro-base label {
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 4px;
}
.mapa-filtro-base select {
    width: 100%;
}

/* Info e progresso */
.mapa-sidebar-info {
    padding: 0 1.25rem .5rem;
    font-size: .8rem;
    color: #64748b;
}
.mapa-progress {
    margin-top: 4px;
    color: #e8722a;
    font-weight: 500;
}
/* ── Telemetria: segmented control de visão ──────────────────── */
.tel-segmented {
    display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px;
    overflow: hidden; background: #f8fafc;
}
.tel-segmented button {
    border: none; background: transparent; padding: 6px 12px;
    font-size: 12px; font-weight: 600; color: #64748b; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s, color .15s;
    border-right: 1px solid #e2e8f0;
}
.tel-segmented button:last-child { border-right: none; }
.tel-segmented button:hover { background: #eef2f7; color: #1e2d4a; }
.tel-segmented button.ativo {
    background: #e8722a; color: #fff;
}
.tel-segmented button.ativo:hover { background: #d4651f; }

.mapa-legenda-exec {
    display: flex; flex-wrap: wrap; gap: .4rem .75rem;
    margin-top: .5rem; font-size: .7rem; color: #475569;
}
.mapa-legenda-exec .mapa-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    margin-right: .3rem; vertical-align: middle; border: 1.5px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* Filtros */
.mapa-filtros {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 0 1.25rem .75rem;
}
.mapa-filtro-lote {
    font-size: .82rem;
}

/* Busca */
.mapa-busca-wrap {
    position: relative;
    padding: 0;
}
.mapa-busca-icon {
    position: absolute;
    left: calc(1.25rem + 10px);
    top: 9px;
    color: #94a3b8;
    font-size: .8rem;
}
.mapa-busca-input {
    padding-left: 2rem !important;
    font-size: .82rem;
}

/* Lista scrollável de obras */
.mapa-obras-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.25rem 1rem;
}

/* Card de cada obra */
.mapa-obra-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .75rem;
    margin-bottom: .5rem;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.mapa-obra-card:not(.sem-coord) { cursor: pointer; }
.mapa-obra-card:hover { border-color: #cbd5e1; }
.mapa-obra-card.selecionada {
    border-color: #e8722a;
    background: #fff8f5;
    box-shadow: 0 0 0 2px rgba(232,114,42,.18);
}

/* Marcador pulsante da obra selecionada */
@keyframes obra-pulse {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0   rgba(232,114,42,.7); }
    60%  { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(232,114,42,0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0   rgba(232,114,42,0); }
}
.obra-pulse-dot {
    width: 18px;
    height: 18px;
    background: #e8722a;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: obra-pulse 1.2s ease-out infinite;
}
.mapa-obra-card.sem-coord { opacity: .55; }

.mapa-obra-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.mapa-obra-codigo {
    font-weight: 700;
    font-size: .85rem;
    color: #1e2d4a;
}
.mapa-obra-tipo {
    font-size: .72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.mapa-obra-mun {
    font-size: .78rem;
    color: #64748b;
    margin-top: 2px;
}
.mapa-obra-mun i {
    color: #e8722a;
    margin-right: 4px;
    font-size: .7rem;
}

/* Badges de distância / tempo / base */
.mapa-obra-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: .5rem;
}
.mapa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
}
.mapa-badge.dist {
    background: #eff6ff;
    color: #2563eb;
}
.mapa-badge.tempo {
    background: #f0fdf4;
    color: #16a34a;
}
.mapa-badge.base {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
}
.mapa-badge.fallback {
    background: #fffbeb;
    color: #b45309;
}
.mapa-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mapa-obra-aviso {
    font-size: .72rem;
    color: #f59e0b;
    margin-top: 4px;
}

.mapa-obra-detalhes {
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid #f0e8e3;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.mapa-detalhe-row {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
}
.mapa-detalhe-row span:first-child {
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .03em;
}
.mapa-detalhe-row span:last-child {
    color: #1e2d4a;
    font-weight: 500;
}

/* Popup de obra no mapa */
.mapa-popup-obra { min-width: 180px; }
.mapa-popup-titulo { font-weight: 700; font-size: .9rem; color: #1e2d4a; margin-bottom: .1rem; }
.mapa-popup-tipo { font-size: .78rem; color: #64748b; margin-bottom: .25rem; }
.mapa-popup-mun { font-size: .8rem; color: #475569; margin-bottom: .4rem; }
.mapa-popup-row { display: flex; justify-content: space-between; gap: .75rem; font-size: .76rem; border-top: 1px solid #f1f5f9; padding-top: .2rem; margin-top: .2rem; }
.mapa-popup-row span:first-child { font-weight: 600; color: #94a3b8; text-transform: uppercase; font-size: .68rem; letter-spacing: .03em; white-space: nowrap; }
.mapa-popup-row span:last-child { color: #1e2d4a; font-weight: 500; text-align: right; }

/* Legenda Leaflet */
.mapa-legend {
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    font-size: .78rem;
    line-height: 1.6;
}
.mapa-legend strong {
    display: block;
    margin-bottom: 4px;
    color: #1e2d4a;
}
.mapa-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}
.mapa-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ============================================================
   OBRA DETALHE
   ============================================================ */
.obra-detalhe-page { max-width: 100%; }

.obra-hero-shell {
    margin-bottom: .85rem;
}

.obra-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-radius: 18px;
    margin-bottom: .5rem;
    background:
        radial-gradient(circle at top right, rgba(232,114,42,.16), transparent 32%),
        linear-gradient(135deg, #1f2a44 0%, #243452 54%, #1a2237 100%);
    box-shadow: 0 16px 34px rgba(19, 28, 47, .18);
}

.obra-hero-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.obra-hero-back {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: #e2e8f0;
    margin-top: .15rem;
}

.obra-hero-back:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}

.obra-hero-copy {
    min-width: 0;
    flex: 1;
}

.obra-hero-overline {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(226,232,240,.62);
    margin-bottom: .15rem;
}

.obra-hero-title-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.obra-hero-title {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.obra-hero-status {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
}

.obra-hero-priority {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .75rem;
    border-radius: 999px;
    background: rgba(250,204,21,.17);
    color: #fde68a;
    font-size: .74rem;
    font-weight: 800;
}

.obra-hero-subline {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    margin-top: .35rem;
    color: rgba(226,232,240,.82);
    font-size: .82rem;
}

.obra-hero-subline span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.obra-hero-subline i { color: #f4a261; }

.obra-hero-chips {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.obra-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .75rem;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 700;
}

.obra-chip-dark {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.88);
}

.obra-chip-success {
    background: rgba(34,197,94,.16);
    color: #bbf7d0;
}

.obra-chip-warn {
    background: rgba(245,158,11,.16);
    color: #fde68a;
}

.obra-hero-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.obra-hero-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .7rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.obra-hero-link:hover {
    background: rgba(255,255,255,.14);
}

.obra-hero-plan {
    min-height: 44px;
    padding-inline: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(232,114,42,.25);
}

.obra-detalhe-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.obra-detalhe-titulo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e2d4a;
    margin: 0;
    line-height: 1.1;
}
.obra-detalhe-sub {
    font-size: .85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.obra-detalhe-base {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #f1f5f9;
    color: #475569;
    font-size: .72rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 7px;
}
.obra-status-badge {
    font-size: .75rem;
    padding: .3rem .8rem;
    white-space: nowrap;
    max-width: none;
}
.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .45rem .9rem;
    font-size: .83rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.btn-voltar:hover { background: #f1f5f9; color: #1e2d4a; }

.obra-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .85rem;
}
.obra-kpi-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    padding: .7rem .9rem;
    border: 1px solid #e5edf7;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}
.obra-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: #e2e8f0;
}
.obra-kpi-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #13203a;
    line-height: 1.05;
    letter-spacing: -.03em;
}
.obra-kpi-value-sm { font-size: 1.15rem; }
.obra-kpi-label {
    font-size: .66rem;
    color: #7b8aa5;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .3rem;
    font-weight: 800;
}
.obra-kpi-meta {
    font-size: .68rem;
    color: #6b7c98;
    margin-top: .2rem;
    font-weight: 600;
}

.obra-kpi-card-indigo::before   { background: linear-gradient(90deg, #6366f1, #818cf8); }
.obra-kpi-card-cyan::before     { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.obra-kpi-card-amber::before    { background: linear-gradient(90deg, #f97316, #fbbf24); }
.obra-kpi-card-priority::before { background: linear-gradient(90deg, #f59e0b, #fde68a); }
.obra-kpi-card-green::before    { background: linear-gradient(90deg, #22c55e, #86efac); }
.obra-tone-success::before      { background: linear-gradient(90deg, #16a34a, #4ade80); }
.obra-tone-warn::before         { background: linear-gradient(90deg, #f59e0b, #facc15); }
.obra-tone-danger::before       { background: linear-gradient(90deg, #ef4444, #f87171); }
.obra-tone-neutral::before      { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

.obra-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: .75rem;
    margin-bottom: 1rem;
}

.obra-panel {
    padding: .9rem 1.05rem;
}

.obra-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .55rem;
}

.obra-panel-title {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: 1rem;
    font-weight: 800;
    color: #13203a;
}

.obra-panel-title i { color: #e8722a; }

.obra-panel-note {
    color: #94a3b8;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.obra-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.obra-fact {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .55rem .8rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
}

.obra-fact-wide {
    grid-column: 1 / -1;
}

.obra-fact-label {
    font-size: .65rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.obra-fact-value {
    font-size: .85rem;
    font-weight: 700;
    color: #1f2a44;
}

.obra-fact-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .84rem;
}

.obra-panel-divider {
    height: 1px;
    background: #eef2f7;
    margin: .65rem 0;
}

.obra-nearby-title {
    font-size: .76rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .55rem;
}

.obra-nearby-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.obra-nearby-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .72rem;
    border-radius: 999px;
    background: #fff4ec;
    color: #d4621a;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 800;
}

.obra-nearby-chip span {
    color: #8a94a6;
    font-weight: 700;
}

.obra-detalhe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.obra-secao {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: .85rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.obra-secao-titulo {
    font-size: .85rem;
    font-weight: 700;
    color: #1e2d4a;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.obra-secao-titulo i { color: #e8722a; }
.obra-secao-titulo-toggle {
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    padding: .25rem .5rem;
    margin: -.25rem -.5rem .75rem;
    transition: background .15s;
}
.obra-secao-titulo-toggle:hover { background: #f1f5f9; }
.obra-secao-chevron { color: #94a3b8 !important; margin-left: 0; }
.obra-secao-count {
    font-size: .75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-left: auto;
}

/* Busca inline de orçamento */
.obra-orcamento-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .4rem .75rem;
    margin-bottom: .75rem;
}
.obra-orcamento-search > i { color: #94a3b8; font-size: .8rem; flex-shrink: 0; }
.obra-orcamento-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .82rem;
    color: #1e2d4a;
    outline: none;
}
.obra-orcamento-input::placeholder { color: #cbd5e1; }
.obra-orcamento-count {
    font-size: .72rem;
    color: #64748b;
    white-space: nowrap;
}
.obra-orcamento-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}
.obra-orcamento-clear:hover { color: #ef4444; }
.obra-detalhe-mapa {
    height: 380px;
    border-radius: 8px;
    overflow: hidden;
}
.obra-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1.5rem;
}
.obra-info-row label {
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
    margin-bottom: .15rem;
}
.obra-info-row span {
    font-size: .9rem;
    color: #1e2d4a;
    font-weight: 500;
}
.obra-info-desl { display: flex; align-items: center; gap: .4rem; }
.obra-info-desl i { color: #10b981; font-size: .8rem; }
.obra-info-estimado { font-size: .75rem; color: #94a3b8; font-weight: 400; }
.obra-sem-dados {
    color: #94a3b8;
    font-size: .85rem;
    padding: .5rem 0;
}

.obra-doc-loading {
    color: #94a3b8;
    font-size: .85rem;
}

.obra-doc-box {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff8f5 0%, #ffffff 100%);
    border: 1px solid #f2dfd3;
}

.obra-doc-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #f5d0c0;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.obra-doc-copy {
    min-width: 0;
    flex: 1;
}

.obra-doc-name {
    font-size: .98rem;
    font-weight: 800;
    color: #1f2a44;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obra-doc-sub {
    font-size: .77rem;
    color: #7c8ca6;
    margin-top: .2rem;
}

.obra-doc-link {
    color: #d4621a;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.obra-doc-icon-link {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: .9rem;
    padding: .25rem;
    text-decoration: none;
}

.obra-doc-icon-link-danger { color: #dc2626; }

.obra-doc-empty {
    text-align: center;
    padding: 1.5rem 0;
    color: #94a3b8;
    font-size: .85rem;
}

.obra-doc-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
}

.obra-doc-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .65rem 1rem;
    border: 1px dashed #d7dee8;
    border-radius: 12px;
    font-size: .8rem;
    color: #d4621a;
    cursor: pointer;
    font-weight: 800;
    background: #fffaf6;
}

.obra-budget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.obra-budget-card {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .9rem 1rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.obra-budget-card strong {
    font-size: 1.15rem;
    color: #1f2a44;
    line-height: 1.1;
}

.obra-budget-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    font-weight: 800;
}

.obra-budget-meta {
    font-size: .76rem;
    color: #6d7f9b;
    font-weight: 600;
}

/* documentos */
.obra-doc-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .6rem 1rem;
    margin-bottom: .75rem;
}
.obra-doc-icon { font-size: 1.4rem; color: #ef4444; flex-shrink: 0; }
.obra-doc-nome { font-size: .9rem; font-weight: 600; color: #1e2d4a; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-doc-acao {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .78rem; font-weight: 600; padding: .3rem .7rem;
    border-radius: 6px; border: none; cursor: pointer; text-decoration: none;
    white-space: nowrap;
}
.btn-doc-ver    { background: #eff6ff; color: #3b82f6; }
.btn-doc-ver:hover { background: #dbeafe; }
.btn-doc-baixar { background: #f0fdf4; color: #16a34a; }
.btn-doc-baixar:hover { background: #dcfce7; }
.btn-doc-excluir { background: #fef2f2; color: #ef4444; }
.btn-doc-excluir:hover { background: #fee2e2; }
.btn-doc-upload {
    display: inline-flex; align-items: center; gap: .5rem;
    background: #1e2d4a; color: #fff; font-size: .82rem; font-weight: 600;
    padding: .45rem 1rem; border-radius: 8px; cursor: pointer;
    transition: background .15s;
}
.btn-doc-upload:hover { background: #e8722a; }

/* dias restantes */
.dias-ok    { color: #10b981; font-weight: 700; }
.dias-aviso { color: #f59e0b; font-weight: 700; }
.dias-critico { color: #ef4444; font-weight: 700; }

/* tabela obras — linhas clicáveis */
.obras-row-link { cursor: pointer; }
.obras-row-link:hover td { background: #fef6f2; }

/* ícone de link no card do mapa */
.mapa-obra-link {
    color: #94a3b8;
    font-size: .7rem;
    margin-left: auto;
    padding: .1rem .25rem;
    text-decoration: none;
    line-height: 1;
}
.mapa-obra-link:hover { color: #e8722a; }

@media (max-width: 768px) {
    .obra-hero {
        padding: 1.1rem;
        border-radius: 18px;
    }
    .obra-hero,
    .obra-hero-left {
        flex-direction: column;
    }
    .obra-hero-title {
        font-size: 1.8rem;
    }
    .obra-hero-actions {
        width: 100%;
        justify-content: stretch;
    }
    .obra-hero-link,
    .obra-hero-plan {
        width: 100%;
        justify-content: center;
    }
    .obra-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .obra-main-grid { grid-template-columns: 1fr; }
    .obra-detalhe-grid  { grid-template-columns: 1fr; }
    .obra-info-grid     { grid-template-columns: 1fr; }
    .obra-facts-grid,
    .obra-budget-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PLANEJAMENTO
   ============================================================ */
/* Quando plan-page está ativo, remove o padding/margem extra do opus-main e oculta o footer */
.opus-main:has(.plan-page) {
    padding: 0;
    margin-top: calc(var(--nav-height) + var(--nav-float));
    min-height: unset;
    height: calc(100vh - var(--nav-height) - var(--nav-float));
    overflow: hidden;
}
.opus-main:has(.plan-page) ~ .opus-footer { display: none; }
html:has(.plan-page),
body:has(.plan-page) { overflow: hidden; height: 100%; }
.plan-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height, 60px) - var(--nav-float, 12px));
    overflow: hidden;
}
.btn-planejar {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #1e2d4a; color: #fff; font-size: .82rem; font-weight: 600;
    padding: .45rem 1rem; border-radius: 8px; border: none; cursor: pointer;
    transition: background .15s;
}
.btn-planejar:hover { background: #e8722a; }
.btn-plan-nova {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #e8722a; color: #fff; font-size: .82rem; font-weight: 600;
    padding: .45rem 1rem; border-radius: 8px; border: none; cursor: pointer;
    transition: background .15s;
}
.btn-plan-nova:hover { background: #d4621a; }
.plan-nova-sidebar {
    width: calc(100% - 1rem); margin: .5rem .5rem 0; border-radius: 8px;
    justify-content: center;
}
.plan-pdf-btn-voltar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: #fff; color: #1e2d4a; font-size: .82rem; cursor: pointer;
    transition: background .15s; flex-shrink: 0;
}
.plan-pdf-btn-voltar:hover { background: #f1f5f9; }
.plan-pdf-obra-info { display: flex; flex-direction: column; line-height: 1.2; }
.plan-pdf-obra-codigo { font-size: .85rem; font-weight: 800; color: #1e2d4a; }
.plan-pdf-obra-sub { font-size: .7rem; color: #94a3b8; }
.plan-pdf-obra-ctx { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.plan-pdf-ctx-chip {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .68rem; font-weight: 600; color: #475569;
    border: 1px solid #cbd5e1; border-radius: 20px;
    padding: 1px 7px; background: #f8fafc; white-space: nowrap;
}
.plan-pdf-ctx-chip i { font-size: .6rem; }

.plan-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* PDF panel */
.plan-pdf-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
    position: relative;
}
.plan-pdf-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.plan-pdf-titulo { font-size: .82rem; font-weight: 600; color: #1e2d4a; display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.plan-pdf-btn {
    background: none; border: 1px solid transparent; border-radius: 5px;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #475569; font-size: .8rem; transition: background .12s, color .12s;
}
.plan-pdf-btn:hover:not(:disabled) { background: rgba(255,255,255,.85); border-color: #e2e8f0; color: #1e293b; }
.plan-pdf-btn:disabled { opacity: .35; cursor: default; }
.plan-pdf-btn-ativo { background: #fff3ed !important; color: #e8722a !important; border-color: #e8722a !important; }
.plan-pdf-zoom { font-size: .75rem; font-weight: 700; color: #1e2d4a; min-width: 36px; text-align: center; }
.plan-pdf-pages { font-size: .72rem; color: #64748b; white-space: nowrap; padding: 0 2px; }
.plan-pdf-sep { width: 1px; height: 18px; background: #e2e8f0; margin: 0 .25rem; }

/* Header progress bar */
.plan-hdr-prog {
    display: flex; align-items: center; gap: .75rem;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: .35rem .85rem;
    cursor: default; margin-left: auto; flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.plan-hdr-prog-left {
    display: flex; flex-direction: column; align-items: center;
    min-width: 40px; border-right: 1px solid #f1f5f9; padding-right: .75rem;
}
.plan-hdr-prog-pct {
    font-size: 1.15rem; font-weight: 800; color: #1e2d4a; line-height: 1;
}
.plan-hdr-prog-pct small { font-size: .62rem; font-weight: 600; color: #64748b; }
.plan-hdr-prog-sub { font-size: .6rem; color: #94a3b8; margin-top: .05rem; }
.plan-hdr-prog-center {
    display: flex; flex-direction: column; gap: .25rem; min-width: 160px;
}
.plan-hdr-prog-bar {
    height: 8px; background: #e2e8f0; border-radius: 4px;
    overflow: hidden; display: flex;
}
.plan-hdr-prog-exec { background: #16a34a; height: 100%; transition: width .4s; }
.plan-hdr-prog-prog { background: #f59e0b; height: 100%; transition: width .4s; }
.plan-hdr-prog-legenda {
    display: flex; gap: .6rem;
}
.plan-hdr-prog-legenda span {
    display: flex; align-items: center; gap: .2rem;
    font-size: .65rem; color: #64748b; white-space: nowrap;
}
.plan-hdr-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.plan-hdr-dot-exec { background: #16a34a; }
.plan-hdr-dot-prog { background: #f59e0b; }
.plan-hdr-dot-pend { background: #e2e8f0; border: 1px solid #cbd5e1; }
.plan-hdr-prog-total {
    display: flex; flex-direction: column; align-items: center;
    border-left: 1px solid #f1f5f9; padding-left: .75rem;
}
.plan-hdr-prog-total-label { font-size: .6rem; color: #94a3b8; }
.plan-hdr-prog-total-val { font-size: .85rem; font-weight: 700; color: #1e2d4a; }

/* Ghost bar flutuante sobre o canvas */
.plan-ghost-bar {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 2px;
    background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,.9); border-radius: 30px;
    box-shadow: 0 3px 12px rgba(0,0,0,.1);
    padding: 3px 10px; z-index: 15;
    opacity: .3; transition: opacity .2s ease;
    pointer-events: auto;
}
.plan-ghost-bar:hover { opacity: 1; }
.plan-ghost-sep { width: 1px; height: 16px; background: #e2e8f0; margin: 0 3px; flex-shrink: 0; }

/* Outer: posicionamento da ghost bar (não scrolla) */
.plan-pdf-canvas-outer {
    flex: 1; position: relative; overflow: hidden;
    display: flex; flex-direction: column;
}
/* Inner: scroll do conteúdo do PDF */
.plan-pdf-canvas-wrap {
    flex: 1; overflow: auto; background: #e2e8f0;
    padding: 1rem;
}
.plan-pdf-canvas {
    width: fit-content;
    margin: 0 auto;
}
.plan-pdf-canvas canvas { box-shadow: 0 4px 24px rgba(0,0,0,.18); }

/* Overlay de pontos */
.plan-pdf-overlay {
    position: absolute; top: 0; left: 0;
    pointer-events: none;
    z-index: 5;
}
.plan-pdf-overlay-ativo { pointer-events: all; cursor: crosshair; }
.plan-pdf-overlay-anot  { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23f59e0b' d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E") 0 20, cell; }

/* Marcador de ponto */
.plan-ponto-marker {
    position: absolute;
    width: 22px; height: 22px;
    background: #e8722a;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
    cursor: pointer;
    transition: transform .15s;
    pointer-events: all;
    user-select: none;
}
.plan-ponto-marker:hover { transform: scale(1.2); }
.plan-ponto-marker-sel { background: #1e2d4a; border-color: #e8722a; transform: scale(1.15); }
.plan-ponto-marker-sl { box-shadow: 0 0 0 3px #16a34a; }
.plan-ponto-marker-dl { box-shadow: 0 0 0 3px #dc2626; }
/* Modo "esmaecer PDF" — reduz intensidade do canvas sem afetar overlays */
.plan-pdf-faded > canvas {
    opacity: var(--pdf-opacity, 1);
    filter: grayscale(var(--pdf-gray, 0)) contrast(0.95);
    transition: opacity .2s, filter .2s;
}
.plan-pdf-faded .plan-ponto-marker {
    box-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.25);
}

.plan-ponto-marker-prog { background: #2563eb; }
.plan-ponto-marker-conc { background: #16a34a; }
.plan-ponto-marker-atra { background: #dc2626; }
.plan-ponto-marker-prog.plan-ponto-marker-sel,
.plan-ponto-marker-conc.plan-ponto-marker-sel,
.plan-ponto-marker-atra.plan-ponto-marker-sel { background: #1e2d4a; }

/* Badge de vão entre folhas (cross-folha) */
.plan-cross-badge {
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border: 1.5px solid #e8722a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #e8722a;
    font-size: 8px; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    cursor: pointer;
    z-index: 11;
    pointer-events: all;
    transition: transform .15s;
}
.plan-cross-badge:hover { transform: scale(1.25); background: #e8722a; color: #fff; }
.plan-cross-badge i { font-size: 7px; }

/* Banner do modo conectar entre folhas */
.plan-cross-mode-banner {
    position: absolute;
    bottom: 14px; left: 50%;
    transform: translateX(-50%);
    background: #1e2d4a;
    color: #fff;
    border: 2px solid #e8722a;
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .78rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: .6rem;
    pointer-events: all;
}
.plan-cross-mode-banner i { color: #e8722a; }
.plan-cross-mode-banner button {
    background: #e8722a; color: #fff;
    border: none; border-radius: 4px;
    padding: .25rem .55rem;
    font-size: .7rem; font-weight: 600;
    cursor: pointer;
}
.plan-cross-mode-banner button:hover { background: #d65f1c; }
.plan-cross-mode-banner-erro {
    color: #fecaca;
    font-size: .7rem;
    font-weight: 500;
    margin-left: .35rem;
}
.plan-cross-mode-hint {
    color: #cbd5e1;
    font-size: .68rem;
    font-weight: 500;
    background: rgba(255,255,255,.06);
    border-radius: 4px;
    padding: .15rem .45rem;
    margin-left: .25rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.plan-cross-mode-hint i { color: #94a3b8 !important; font-size: .65rem; }

/* Input inline novo ponto */
.plan-ponto-novo-wrap {
    position: absolute;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    z-index: 30;
    pointer-events: all;
}
.plan-ponto-novo-marker {
    width: 24px; height: 24px;
    background: #e8722a;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.plan-ponto-novo-marker i {
    transform: rotate(45deg);
    color: #fff;
    font-size: .65rem;
}
.plan-ponto-novo-bubble {
    background: #fff;
    border: 2px solid #e8722a;
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    min-width: 80px;
}
.plan-ponto-novo-input {
    border: none;
    outline: none;
    font-size: .95rem;
    font-weight: 700;
    width: 60px;
    text-align: center;
    color: #1e2d4a;
    background: transparent;
    font-family: inherit;
}
.plan-ponto-novo-hint {
    font-size: .58rem;
    color: #94a3b8;
    text-align: center;
    white-space: nowrap;
}
.plan-ponto-novo-input-erro { color: #dc2626 !important; }
.plan-ponto-novo-erro {
    font-size: .65rem;
    color: #dc2626;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

/* Chips de tipo de ponto (Árvore / Aterramento / Genérico) na bolha do novo ponto */
.plan-ponto-tipo-chips {
    display: flex; justify-content: center; gap: 4px; margin: 2px 0 1px;
}
.plan-tipo-chip {
    width: 22px; height: 22px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid #cbd5e1; border-radius: 6px;
    background: #f8fafc; color: #64748b;
    cursor: pointer; transition: all .12s;
}
.plan-tipo-chip:hover { border-color: #94a3b8; background: #f1f5f9; }
.plan-tipo-chip i { font-size: .65rem; }
.plan-tipo-chip.ativo { border-color: #1e2d4a; background: #1e2d4a; color: #fff; }
.plan-tipo-chip-arvore.ativo  { border-color: #16a34a; background: #dcfce7; color: #15803d; }
.plan-tipo-chip-aterra.ativo { border-color: #f59e0b; background: #fef3c7; color: #b45309; }

/* ── Busca inline de kit na popup do ponto ──────────────────────────────────
   Permite associar um kit sem abrir o modal completo; cobre o caminho rápido. */
.plan-ponto-popup:has(.plan-popup-kit-search) { max-width: 360px; min-width: 300px; }
.plan-popup-kit-search {
    display: flex; flex-direction: column; gap: .3rem;
    padding: .4rem 0 .45rem;
    border-bottom: 1px dashed #e2e8f0;
    margin-bottom: .4rem;
}
.plan-popup-busca-wrap { height: 28px; }
.plan-popup-busca { font-size: .78rem; padding: 0 .45rem 0 1.55rem; }
.plan-popup-busca-wrap > i.fa-search { font-size: .7rem; left: .5rem; }
.plan-popup-acao-toggle { display: inline-flex; gap: 4px; align-self: flex-start; }
.plan-popup-acao-toggle .kit-acao-toggle-btn {
    font-size: .62rem; padding: 2px 8px; line-height: 1.5;
}
.plan-popup-search-dropdown {
    position: static;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}
.plan-popup-search-result { padding: .35rem .5rem; }

/* ── Pílula flutuante: modal de kits minimizado ─────────────────────────── */
.kits-mini-pill {
    position: fixed;
    bottom: 18px; right: 18px;
    z-index: 60;
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .55rem .75rem .55rem .85rem;
    background: #1e2d4a; color: #fff;
    border: 2px solid #e8722a;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    cursor: pointer;
    font-size: .8rem; font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease;
    user-select: none;
}
.kits-mini-pill:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.kits-mini-pill i.fa-toolbox { color: #e8722a; }
.kits-mini-pill-ctx { font-weight: 700; }
.kits-mini-pill-count {
    background: #e8722a; color: #fff;
    min-width: 22px; height: 22px; padding: 0 7px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
}
.kits-mini-pill-busca {
    font-size: .7rem; color: #e2e8f0; font-weight: 500;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border-left: 1px solid rgba(226,232,240,.3); padding-left: .55rem;
}
.kits-mini-pill-busca i { font-size: .6rem; margin-right: .3rem; }
.kits-mini-pill-expand, .kits-mini-pill-close {
    width: 22px; height: 22px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12); color: #fff;
    border: none; border-radius: 50%; cursor: pointer;
    font-size: .7rem;
}
.kits-mini-pill-expand:hover { background: rgba(255,255,255,.22); }
.kits-mini-pill-close:hover { background: #dc2626; }

/* Marker tipado — mantém o número no centro e muda apenas a FORMA.
   - Árvore:     squircle orgânico (cantos arredondados assimétricos → cara de "folha").
   - Aterramento: teardrop (gota) com ponta para baixo, clássica forma de map-pin.
   O formato vem de um ::before que cobre a área visual; o texto (número) fica
   por cima através de isolation:isolate + z-index negativo do ::before. */
.plan-ponto-marker-tipo {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #fff;
    overflow: visible;
    padding: 0;
    isolation: isolate;
}
.plan-ponto-marker-tipo::before {
    content: "";
    position: absolute;
    inset: -4px;
    background: var(--marker-bg, #16a34a);
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.55);
    z-index: -1;
}
.plan-ponto-marker-arvore  { --marker-bg: #16a34a; }
.plan-ponto-marker-aterra { --marker-bg: #d97706; }

/* Árvore — copa em formato de nuvem/lóbulos.
   Usa mask-image: o background (colorido por --marker-bg e sobrescrito por status)
   aparece só dentro do contorno da copa. O "contorno branco" é simulado com
   drop-shadows 1px em 4 direções — funciona com qualquer silhueta irregular. */
.plan-ponto-marker-arvore::before {
    border: none;
    border-radius: 0;
    box-shadow: none;
    inset: -5px;
    -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='14' r='12'/%3E%3Ccircle cx='10' cy='22' r='10'/%3E%3Ccircle cx='30' cy='22' r='10'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='14' r='12'/%3E%3Ccircle cx='10' cy='22' r='10'/%3E%3Ccircle cx='30' cy='22' r='10'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    filter:
        drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
        drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff)
        drop-shadow(0 2px 3px rgba(0,0,0,.45));
}

/* Aterramento — teardrop: canto inferior-esquerdo sem raio e rotação -45° levam a ponta para baixo-centro */
.plan-ponto-marker-aterra::before {
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

/* Status sobrescreve a cor do tipo — execução é info mais urgente. */
.plan-ponto-marker-tipo.plan-ponto-marker-prog::before { background: #2563eb; }
.plan-ponto-marker-tipo.plan-ponto-marker-conc::before { background: #16a34a; }
.plan-ponto-marker-tipo.plan-ponto-marker-atra::before { background: #dc2626; }
.plan-ponto-marker-tipo.plan-ponto-marker-sel::before  { background: #1e2d4a; border-color: #e8722a; }

/* Popup do ponto selecionado */
.plan-ponto-popup {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.22);
    padding: .6rem .85rem;
    min-width: 240px; max-width: 300px;
    z-index: 10;
    pointer-events: all;
    overflow: visible;
}
.plan-ponto-popup-titulo { font-size: .85rem; font-weight: 700; color: #1e2d4a; margin-bottom: .35rem; }
.plan-ponto-popup-desc { font-size: .78rem; color: #64748b; margin-bottom: .4rem; }
.plan-ponto-popup-audit {
    display: flex; align-items: center; gap: .25rem;
    font-size: .68rem; color: #94a3b8; margin-bottom: .45rem;
}
.plan-ponto-popup-audit i { font-size: .62rem; }
.plan-ponto-popup-audit-sep { color: #cbd5e1; }

/* SL/DL selector no popup */
.plan-popup-tipo-exec {
    display: flex; align-items: center; gap: .3rem;
    margin-bottom: .45rem; flex-wrap: wrap;
}
.plan-popup-tipo-label { font-size: .65rem; color: #94a3b8; flex-shrink: 0; }
.plan-popup-tipo-btn {
    font-size: .65rem; font-weight: 700; padding: 2px 7px;
    border-radius: 4px; border: 1px solid #cbd5e1; background: #f8fafc;
    color: #64748b; cursor: pointer; line-height: 1.5; transition: all .12s;
}
.plan-popup-tipo-btn:hover { border-color: #94a3b8; background: #f1f5f9; }
.plan-popup-tipo-nd-ativo { border-color: #94a3b8; background: #e2e8f0; color: #1e293b; }
.plan-popup-tipo-sl { color: #15803d; }
.plan-popup-tipo-sl-ativo { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.plan-popup-tipo-dl { color: #dc2626; }
.plan-popup-tipo-dl-ativo { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

/* Badge SL/DL na árvore */
.plan-arvore-tipo-badge {
    font-size: .56rem; font-weight: 800; padding: 1px 5px;
    border-radius: 3px; flex-shrink: 0; line-height: 1.55;
}
.plan-arvore-tipo-sl { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.plan-arvore-tipo-dl { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

.plan-ponto-popup-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; gap: .3rem; border-top: 1px solid #f1f5f9; padding-top: .4rem; }
.plan-ponto-popup-pag { font-size: .72rem; color: #94a3b8; flex: 1; }
.plan-ponto-popup-del {
    background: none; border: 1px solid #fca5a5; border-radius: 4px;
    color: #ef4444; font-size: .72rem; padding: .15rem .4rem; cursor: pointer;
}
.plan-ponto-popup-del:hover { background: #fef2f2; }

/* ── Kit compact popup blocks ── */
.kit-popup-bloco { margin-bottom:.3rem; border:1px solid #fed7aa; border-radius:6px; overflow:hidden; }
.kit-popup-bloco:last-child { margin-bottom:0; }
.kit-popup-header {
    display:flex; align-items:center; gap:.35rem;
    padding:.22rem .45rem; background:#fff8f4;
    border-bottom:1px solid #fed7aa;
}
.kit-popup-kit-desc {
    flex:1; color:#92400e; font-size:.68rem;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.kit-popup-itens { display:flex; flex-direction:column; }
.kit-popup-item {
    display:flex; align-items:center; gap:.28rem;
    padding:.14rem .45rem; border-bottom:1px solid #f8fafc;
}
.kit-popup-item:last-child { border-bottom:none; }
.kit-popup-item-exec { background:#f0fdf4; }
.kit-popup-item-tipo {
    font-size:.56rem; font-weight:700; border-radius:3px;
    padding:.05rem .28rem; flex-shrink:0; line-height:1.5;
}
.kit-popup-tipo-mat  { background:#dbeafe; color:#1d4ed8; }
.kit-popup-tipo-serv { background:#dcfce7; color:#15803d; }
.kit-popup-item-cod  { font-size:.64rem; color:#6b7280; white-space:nowrap; flex-shrink:0; }
.kit-popup-item-desc {
    flex:1; font-size:.69rem; color:#374151;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.kit-popup-item-qtd { font-size:.64rem; color:#94a3b8; white-space:nowrap; flex-shrink:0; }

/* ── Inline kit search in popup ── */
.plan-popup-kit-busca { position: relative; margin-bottom: .45rem; }
.plan-popup-kit-input-wrap {
    display: flex; align-items: center; gap: .3rem;
    padding: .3rem .45rem; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px;
}
.plan-popup-kit-input-wrap i { color: #94a3b8; font-size: .68rem; flex-shrink: 0; }
.plan-popup-kit-input {
    border: none; background: transparent; outline: none;
    font-size: .74rem; color: #1e2d4a; flex: 1; min-width: 0;
}
.plan-popup-kit-input::placeholder { color: #94a3b8; }
.plan-popup-kits-list { display: flex; flex-direction: column; gap: .4rem; max-height: 260px; overflow-y: auto; }

.plan-popup-kit-manage {
    width: 100%;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #475569;
    padding: .62rem .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: .45rem;
}

.plan-popup-kit-manage:hover {
    border-color: #fdba74;
    background: #fff7ed;
    color: #c2410c;
}

.plan-ponto-popup-kit {
    background: none; border: 1px solid #bfdbfe; border-radius: 4px;
    color: #3b82f6; font-size: .72rem; padding: .15rem .45rem; cursor: pointer;
    display:inline-flex; align-items:center; gap:.25rem;
}
.plan-ponto-popup-kit:hover { background: #eff6ff; }
.kit-count-badge-sm {
    background: #e8722a; color: #fff; border-radius: 8px;
    font-size: .62rem; font-weight: 700; padding: 0 4px; min-width:14px;
    display:inline-flex; align-items:center; justify-content:center; line-height:14px;
}

/* ── Kit count badge na árvore ── */
.kit-count-badge {
    background: #fff3ed; color: #e8722a; border: 1px solid #fed7aa;
    border-radius: 8px; font-size: .58rem; font-weight: 700;
    padding: 0 5px; min-width:15px; line-height:15px;
    display:inline-flex; align-items:center; justify-content:center;
    flex-shrink:0;
}

/* ── Sem kit indicators ── */
.plan-semkit-resumo {
    display: flex; align-items: center; gap: .25rem; flex-wrap: wrap;
    font-size: .6rem; color: #b45309;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 5px; padding: .2rem .4rem; margin: .2rem .35rem .05rem;
}
.plan-semkit-resumo i { font-size: .6rem; flex-shrink: 0; }
.plan-semkit-sep { color: #d97706; }
.plan-semkit-resumo-btn {
    cursor: pointer; width: calc(100% - .7rem); text-align: left;
    transition: background .12s, border-color .12s;
}
.plan-semkit-resumo-btn:hover { background: #fef3c7; border-color: #fcd34d; }
.plan-semkit-arrow { margin-left: auto; color: #d97706; }
.plan-semkit-dot {
    background: #fef3c7; color: #b45309; border: 1px solid #fde68a;
    border-radius: 50%; font-size: .58rem; font-weight: 800;
    width: 14px; height: 14px; line-height: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; cursor: default;
}

/* ── Modal de kits ── */
.kit-search-dropdown {
    position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:200;
    background:#fff; border:1px solid #e2e8f0; border-radius:8px;
    box-shadow:0 4px 16px rgba(0,0,0,.1); max-height:340px; overflow-y:auto;
}
.kit-search-result {
    display:flex; align-items:center; gap:.5rem; padding:.5rem .75rem;
    cursor:pointer; border-bottom:1px solid #f1f5f9; font-size:.82rem;
    transition:background .1s;
}
.kit-search-result:last-child { border-bottom:none; }
.kit-search-result:hover { background:#f8fafc; }
.kit-search-result-dim { opacity:.6; cursor:default; }
.kit-search-result-dim:hover { background:none; }

/* Tabs do modal Kit/Orçamento */
.modal-kit-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.modal-kit-tab {
    flex: 1;
    padding: .55rem .75rem;
    font-size: .8rem;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    transition: color .15s, border-color .15s;
}
.modal-kit-tab:hover { color: #1e2d4a; }
.modal-kit-tab-ativo { color: #e8722a !important; border-bottom-color: #e8722a !important; background: #fff; }

/* Badge Lote */
.lote-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    padding: .1rem .4rem;
}
.lote-badge-sm { font-size: .65rem; padding: .05rem .3rem; }

/* Aba Orçamento — header selecionar todos */
.lote-orc-sel-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.lote-orc-sel-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: #475569;
    cursor: pointer;
}
.lote-orc-sel-count {
    margin-left: auto;
    font-size: .75rem;
    font-weight: 600;
    color: #e8722a;
}

/* Grupo título */
.lote-orc-grupo-titulo {
    font-size: .73rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .5rem 0 .25rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.lote-orc-grupo-toggle {
    cursor: pointer;
    user-select: none;
}
.lote-orc-grupo-toggle:hover { color: #334155; }
.lote-orc-chevron {
    margin-left: auto;
    font-size: .65rem;
    color: #94a3b8;
}

/* Item de orçamento com checkbox */
.lote-orc-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .4rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: .8rem;
    transition: background .1s;
}
.lote-orc-item:hover { background: #f1f5f9; }
.lote-orc-item-sel { background: #fff7ed; }
.lote-orc-item-sel:hover { background: #ffedd5; }
.lote-orc-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
}
.lote-orc-qtd {
    font-size: .72rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.kit-assoc-bloco {
    border:1px solid #e2e8f0; border-radius:8px; overflow:hidden;
    flex-shrink: 0;
}
.kit-assoc-bloco.kit-assoc-bloco-concluido,
.kit-assoc-bloco.kit-assoc-bloco-preopus {
    border-left: 3px solid #16a34a;
}
.kit-assoc-header {
    display:flex; align-items:center; gap:.5rem; padding:.5rem .75rem;
    background:#f8fafc; border-bottom:1px solid #e2e8f0; font-size:.82rem;
}
.kit-assoc-chevron-btn {
    background:none; border:none; cursor:pointer; padding:.1rem .25rem;
    color:#94a3b8; font-size:.7rem; line-height:1; border-radius:4px;
    flex-shrink:0; transition:color .12s, background .12s;
}
.kit-assoc-chevron-btn:hover { color:#1e2d4a; background:#e2e8f0; }
.kit-assoc-count {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:22px; height:22px; padding:0 .4rem;
    font-size:.68rem; font-weight:700; color:#64748b;
    background:#f1f5f9; border:1px solid #e2e8f0; border-radius:999px;
    flex-shrink:0;
}

/* Barra de recolher todos os kits no modal */
.kit-modal-colapso-bar {
    display:flex; align-items:center; gap:.5rem;
    padding:.4rem 1.25rem; border-bottom:1px solid #f1f5f9;
    background:#fafbfc; flex-shrink:0;
}
.kit-modal-colapso-btn {
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.25rem .55rem; border:1px solid #e2e8f0; border-radius:6px;
    background:#fff; color:#475569; font-size:.72rem; font-weight:600;
    cursor:pointer; transition:all .12s;
}
.kit-modal-colapso-btn:hover:not(:disabled) { color:#1e2d4a; border-color:#cbd5e1; background:#f8fafc; }
.kit-modal-colapso-btn:disabled { opacity:.45; cursor:not-allowed; }
.kit-modal-colapso-btn i { font-size:.6rem; }
.kit-modal-colapso-info { font-size:.7rem; color:#94a3b8; margin-left:auto; }

/* Lista de kits no modal — scrollbar sempre visível */
.kit-modal-lista {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: 100%;
    overflow-y: scroll !important;
    padding: .75rem 1rem .75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: #e8722a #f1f5f9;
}
.kit-modal-lista::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 14px;
    background: #f1f5f9;
}
.kit-modal-lista::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
}
.kit-modal-lista::-webkit-scrollbar-thumb {
    background: #e8722a;
    border-radius: 8px;
    border: 3px solid #f1f5f9;
    min-height: 40px;
}
.kit-modal-lista::-webkit-scrollbar-thumb:hover { background: #c2410c; }

.kit-assoc-desc {
    flex:1; color:#475569; font-size:.8rem;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.kit-assoc-qtd-wrap {
    display:flex;
    align-items:center;
    gap:.35rem;
    padding:.15rem .2rem .15rem .55rem;
    border-left:1px solid #e2e8f0;
    flex-shrink:0;
}
.kit-assoc-qtd-label {
    font-size:.68rem;
    font-weight:700;
    color:#64748b;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.kit-assoc-qtd-input {
    width:72px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    background:#fff;
    color:#1e293b;
    font-size:.76rem;
    font-weight:700;
    padding:.28rem .45rem;
    outline:none;
}
.kit-assoc-qtd-input:focus {
    border-color:#f97316;
    box-shadow:0 0 0 3px rgba(249,115,22,.12);
}
.kit-assoc-qtd-apply {
    border:1px solid #fdba74;
    background:#fff7ed;
    color:#c2410c;
    border-radius:8px;
    padding:.28rem .55rem;
    font-size:.72rem;
    font-weight:700;
    cursor:pointer;
    transition:all .15s ease;
}
.kit-assoc-qtd-apply:hover:not(:disabled) {
    background:#ffedd5;
    border-color:#fb923c;
}
.kit-assoc-qtd-apply:disabled,
.kit-assoc-qtd-input:disabled {
    opacity:.55;
    cursor:not-allowed;
}
.kit-assoc-state {
    display:inline-flex;
    align-items:center;
    padding:.34rem .62rem;
    border-radius:999px;
    font-size:.72rem;
    font-weight:700;
    white-space:nowrap;
    flex-shrink:0;
}
.kit-assoc-state-locked {
    background:#fff7ed;
    color:#c2410c;
    border:1px solid #fdba74;
}
.kit-assoc-state-concluido {
    background:#dcfce7;
    color:#15803d;
    border:1px solid #86efac;
    gap:.3rem;
}
.kit-assoc-state-preopus {
    background:#ecfdf5;
    color:#047857;
    border:1px solid #6ee7b7;
    gap:.3rem;
}
.kit-assoc-state i { font-size:.65rem; }

.kit-assoc-preopus-btn {
    background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d;
    cursor:pointer; padding:.3rem .45rem; border-radius:6px;
    font-size:.72rem; flex-shrink:0; transition:all .15s;
}
.kit-assoc-preopus-btn:hover { background:#dcfce7; border-color:#86efac; color:#166534; }
.kit-assoc-preopus-btn-revert { background:#f1f5f9; border-color:#e2e8f0; color:#64748b; }
.kit-assoc-preopus-btn-revert:hover { background:#e2e8f0; color:#334155; }
.kit-assoc-preopus-btn-disabled {
    background:#f8fafc; border-color:#e2e8f0; color:#cbd5e1;
    cursor:not-allowed; display:inline-flex; align-items:center;
}
.kit-assoc-preopus-btn-disabled:hover { background:#f8fafc; }

/* Barra inferior "Próximo pendente" no modal de kits */
.kit-modal-proximo-bar {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1.25rem;
    background: #fffbeb; border-top: 1px solid #fde68a;
    flex-shrink: 0;
}
.kit-modal-proximo-info {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: #92400e; flex: 1;
}
.kit-modal-proximo-info i { color: #d97706; font-size: .75rem; }
.kit-modal-proximo-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem; border: none; border-radius: 8px;
    background: #e8722a; color: #fff;
    font-size: .78rem; font-weight: 600; cursor: pointer;
    transition: background .12s;
}
.kit-modal-proximo-btn:hover { background: #c2410c; }
.kit-modal-proximo-btn i { font-size: .7rem; }
.kit-assoc-remover {
    background:none; border:none; color:#94a3b8; cursor:pointer; padding:.1rem .3rem;
    border-radius:4px; font-size:.72rem; flex-shrink:0;
}
.kit-assoc-remover:hover { color:#ef4444; background:#fef2f2; }

.kit-assoc-itens { display:flex; flex-direction:column; }
.kit-item-row-wrap { border-bottom:1px solid #f1f5f9; }
.kit-item-row-wrap:last-child { border-bottom:none; }
.kit-item-row {
    display:flex; align-items:center; gap:.5rem; padding:.35rem .75rem;
    font-size:.8rem;
}
.kit-item-row:last-child { border-bottom:none; }
.kit-item-entrega-info {
    font-size:.68rem; color:#16a34a;
    padding:.15rem .75rem .3rem 2.5rem; line-height:1.3;
    display:flex; align-items:center; gap:.35rem; flex-wrap:wrap;
}
.kit-item-desc {
    flex:1; color:#475569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.kit-item-qtd { color:#64748b; font-size:.75rem; white-space:nowrap; }
.kit-status-btn {
    border:none; border-radius:10px; font-size:.68rem; font-weight:600;
    padding:.15rem .55rem; white-space:nowrap; flex-shrink:0;
}
.kit-status-pend { background:#f1f5f9; color:#64748b; }
.kit-status-prog { background:#dbeafe; color:#1d4ed8; }
.kit-status-exec { background:#dcfce7; color:#16a34a; }
.kit-status-sol  { background:#fef9c3; color:#854d0e; } /* Solicitado */

/* Status como select (no modal) */
.kit-status-sel {
    border:none; border-radius:10px; font-size:.68rem; font-weight:600;
    padding:.15rem .45rem; white-space:nowrap; flex-shrink:0;
    cursor:pointer; outline:none; appearance:none; -webkit-appearance:none;
}
.kit-status-sel.kit-status-pend { background:#f1f5f9; color:#64748b; }
.kit-status-sel.kit-status-pend:hover { background:#e2e8f0; }
.kit-status-sel.kit-status-prog { background:#dbeafe; color:#1d4ed8; }
.kit-status-sel.kit-status-prog:hover { background:#bfdbfe; }
.kit-status-sel.kit-status-exec { background:#dcfce7; color:#16a34a; }
.kit-status-sel.kit-status-exec:hover { background:#bbf7d0; }

/* Botões de ação por item */
.kit-item-btn {
    background:none; border:none; border-radius:4px; padding:.15rem .3rem;
    cursor:pointer; font-size:.7rem; flex-shrink:0; line-height:1;
}
.kit-item-btn-edit  { color:#94a3b8; }
.kit-item-btn-edit:hover  { background:#f1f5f9; color:#475569; }
.kit-item-btn-del   { color:#fca5a5; }
.kit-item-btn-del:hover   { background:#fef2f2; color:#ef4444; }
.kit-item-bloq {
    font-size:.68rem; color:#94a3b8; padding:0 .25rem;
    cursor:default; display:inline-flex; align-items:center;
}
.kit-item-btn-ok    { color:#86efac; }
.kit-item-btn-ok:hover    { background:#dcfce7; color:#16a34a; }
.kit-item-btn-cancel { color:#94a3b8; }
.kit-item-btn-cancel:hover { background:#f1f5f9; color:#475569; }

/* Linha de edição de item */
.kit-item-row-edit { flex-wrap:wrap; gap:.3rem; background:#fafafa; }
.kit-item-edit-tipo {
    font-size:.72rem; border:1px solid #e2e8f0; border-radius:4px;
    padding:.15rem .3rem; flex-shrink:0; background:#fff; outline:none;
}
.kit-item-edit-input {
    font-size:.74rem; border:1px solid #e2e8f0; border-radius:4px;
    padding:.15rem .4rem; background:#fff; outline:none;
}
.kit-item-edit-input:focus { border-color:#e8722a; }

.plan-pdf-camada-oculta { display: none !important; }

/* Popup do trecho selecionado */
.plan-trecho-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .55rem .75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 180px;
    max-width: 280px;
    z-index: 20;
    pointer-events: all;
}

/* Botão de conexão de trecho */
.plan-conectar-btn {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; padding: .5rem .65rem;
    background: none; border: 1px solid #e2e8f0;
    border-radius: 8px; cursor: pointer; text-align: left;
    font-size: .83rem; color: #1e2d4a;
    margin-bottom: .4rem;
    transition: border-color .15s, background .15s;
}
.plan-conectar-btn:hover { border-color: #e8722a; background: #fff3ed; }
.plan-conectar-check {
    display: flex; align-items: center; gap: .6rem;
    width: 100%; padding: .5rem .65rem;
    border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer;
    font-size: .83rem; color: #1e2d4a; margin-bottom: .4rem;
    transition: border-color .15s, background .15s;
}
.plan-conectar-check:has(input:checked) { border-color: #e8722a; background: #fff3ed; }
.plan-conectar-check input[type=checkbox] { accent-color: #e8722a; width:15px; height:15px; cursor:pointer; }
.plan-ponto-mini {
    width: 14px; height: 14px; background: #e8722a;
    border-radius: 50%; color: #fff;
    font-size: 8px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.plan-pdf-vazio {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #94a3b8; gap: .75rem;
}
.plan-pdf-vazio i { font-size: 3rem; color: #cbd5e1; }
.plan-pdf-vazio p { font-size: .95rem; }

/* Programações panel */
.plan-prog-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}
.plan-prog-header {
    display: flex; align-items: center; gap: .5rem;
    padding: .75rem 1rem;
    background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.plan-prog-titulo { font-size: .95rem; font-weight: 700; color: #1e2d4a; }

/* Tabs de alternância */
.plan-prog-tabs {
    display: flex; flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0; background: #fff;
}
.plan-prog-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem .5rem; font-size: .78rem; font-weight: 600; color: #94a3b8;
    background: none; border: none; border-bottom: 2px solid transparent;
    cursor: pointer; transition: color .15s;
}
.plan-prog-tab:hover { color: #1e2d4a; }
.plan-prog-tab-ativo { color: #e8722a !important; border-bottom-color: #e8722a !important; }

/* Árvore do projeto */
.plan-arvore-busca-wrap {
    display: flex; align-items: center; gap: .35rem;
    margin: .35rem .35rem .15rem; padding: .25rem .45rem;
    background: #f1f5f9; border-radius: 6px; border: 1px solid #e2e8f0;
}
.plan-arvore-busca-icon { color: #94a3b8; font-size: .65rem; flex-shrink: 0; }
.plan-arvore-busca {
    flex: 1; border: none; background: transparent;
    font-size: .7rem; color: #1e2d4a; outline: none;
}
.plan-arvore-busca::placeholder { color: #b0bec5; }
.plan-arvore-busca-clear {
    border: none; background: transparent; color: #94a3b8;
    cursor: pointer; padding: 0; font-size: .7rem; line-height: 1;
}
.plan-arvore-busca-clear:hover { color: #475569; }
.plan-arvore-toggle-mat {
    border: 1px solid #e2e8f0; border-radius: 5px; background: transparent;
    color: #94a3b8; cursor: pointer; padding: .18rem .35rem; font-size: .68rem;
    flex-shrink: 0; transition: all .15s; line-height: 1;
}
.plan-arvore-toggle-mat:hover { color: #475569; border-color: #cbd5e1; }
.plan-arvore-toggle-mat-ativo {
    background: #dbeafe; border-color: #93c5fd; color: #1d4ed8;
}
.plan-arvore-toggle-mat-ativo:hover { background: #bfdbfe; }

.plan-arvore { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: .35rem; }
.plan-arvore-scrollable { overflow-y: auto; }
.plan-arvore-secao { margin-bottom: .75rem; }
.plan-arvore-secao { margin-bottom: .35rem; }
.plan-arvore-secao-titulo {
    display: flex; align-items: center; gap: .3rem;
    font-size: .62rem; font-weight: 700; color: #94a3b8; text-transform: uppercase;
    letter-spacing: .03em; padding: .25rem .35rem .15rem;
}
.plan-arvore-secao-titulo-toggle { cursor: pointer; user-select: none; border-radius: 6px; transition: background .12s; }
.plan-arvore-secao-titulo-toggle:hover { background: #f1f5f9; color: #475569; }
.plan-arvore-secao-chevron { font-size: .6rem; width: 10px; text-align: center; color: #cbd5e1; }
.plan-arvore-secao-titulo-toggle:hover .plan-arvore-secao-chevron { color: #64748b; }

/* Subcabeçalho "Vãos" dentro de cada página */
.plan-arvore-subsecao {
    display: flex; align-items: center; gap: .35rem;
    font-size: .62rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .03em;
    padding: .4rem .5rem .2rem 1.15rem;
    margin-top: .2rem;
}
.plan-arvore-subsecao i { color: #e8722a; font-size: .68rem; }
.plan-prog-count-badge-vao {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid #fed7aa;
}
.plan-arvore-ponto {
    display: flex; align-items: center; gap: .35rem;
    padding: .22rem .4rem; border-radius: 6px; cursor: pointer;
    transition: background .12s;
}
.plan-arvore-ponto:hover { background: #f1f5f9; }
.plan-arvore-ponto-ativo { background: #fff3ed; }
.plan-arvore-ponto-info { flex: 1; min-width: 0; }
.plan-arvore-ponto-titulo { font-size: .72rem; font-weight: 600; color: #1e2d4a; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.plan-arvore-ponto-desc { font-size: .62rem; color: #94a3b8; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.plan-arvore-trecho {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem .5rem; border-radius: 6px; font-size: .78rem; color: #475569;
}
.plan-arvore-trecho:hover { background: #f1f5f9; }
.plan-arvore-trecho-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-arvore-vao {
    display: flex; align-items: center; gap: .35rem;
    padding: .22rem .4rem; border-radius: 6px; cursor: pointer;
    transition: background .12s;
}
.plan-arvore-vao:hover { background: #f1f5f9; }
.plan-arvore-vao-ativo { background: #fff3ed !important; }
.plan-arvore-vao-ativo .plan-arvore-vao-label { color: #e8722a !important; }
.plan-arvore-vao-label { color: #475569; font-style: normal; }

/* Status agregado de pontos/vãos na árvore lateral */
.plan-arvore-ponto-prog { background: #eff6ff; border-left: 3px solid #2563eb; padding-left: calc(.5rem - 3px); }
.plan-arvore-ponto-conc { background: #f0fdf4; border-left: 3px solid #16a34a; padding-left: calc(.5rem - 3px); }
.plan-arvore-ponto-atra { background: #fef2f2; border-left: 3px solid #dc2626; padding-left: calc(.5rem - 3px); }
.plan-arvore-ponto-prog .plan-arvore-ponto-titulo { color: #1d4ed8; }
.plan-arvore-ponto-conc .plan-arvore-ponto-titulo { color: #15803d; }
.plan-arvore-ponto-atra .plan-arvore-ponto-titulo { color: #b91c1c; }
.plan-arvore-ponto-prog .plan-arvore-vao-label { color: #1d4ed8 !important; }
.plan-arvore-ponto-conc .plan-arvore-vao-label { color: #15803d !important; }

/* Chevron de recolher/expandir do ponto na árvore */
.plan-arvore-ponto-chevron {
    width: 14px; height: 14px;
    background: transparent; border: none;
    color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0; border-radius: 3px;
    flex-shrink: 0;
}
.plan-arvore-ponto-chevron:hover { background: #e2e8f0; color: #475569; }
.plan-arvore-ponto-chevron i { font-size: .52rem; }
.plan-arvore-ponto-chevron-empty { cursor: default; }
.plan-arvore-ponto-chevron-empty:hover { background: transparent; }

/* Tabela de ajuste de quantidade por trecho */
.qtd-trechos-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; }
.qtd-trechos-tbl thead th {
    position: sticky; top: 0;
    background: #f8fafc; color: #475569;
    text-align: left; font-weight: 700;
    padding: .55rem .6rem; border-bottom: 1px solid #e2e8f0;
    font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
}
.qtd-trechos-tbl tbody td {
    padding: .5rem .6rem; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.qtd-trechos-tbl tbody tr:hover { background: #fff7ed; }
.qtd-trechos-input {
    width: 90px; padding: .3rem .5rem;
    border: 1px solid #cbd5e1; border-radius: 6px;
    font-size: .78rem; text-align: right;
    font-family: inherit;
}
.qtd-trechos-input:focus { outline: none; border-color: #e8722a; box-shadow: 0 0 0 2px rgba(232,114,42,.18); }
.plan-vao-mini {
    width: 14px; height: 14px; background: #e8722a;
    border-radius: 50%; color: #fff;
    font-size: 7px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Kit list na árvore */
.plan-arvore-kit-list {
    margin: .1rem 0 .25rem 1rem;
    border-left: 2px solid #e5e7eb;
    padding-left: .45rem;
}
.plan-arvore-kit-list-vao { margin-left: 1rem; }
.plan-arvore-kit-bloco { margin-bottom: .2rem; }
.plan-arvore-kit-titulo {
    display: flex; align-items: center; gap: .25rem;
    font-size: .65rem; font-weight: 700; color: #e8722a;
    letter-spacing: .02em; padding: .12rem 0 .05rem;
    cursor: pointer; user-select: none; overflow: hidden;
}
.plan-arvore-kit-chevron { font-size: .55rem; flex-shrink: 0; }
.plan-arvore-kit-item {
    display: flex; align-items: flex-start; gap: .25rem;
    padding: .18rem .3rem; font-size: .63rem; min-width: 0;
    border-bottom: 1px solid #f1f5f9; border-radius: 3px;
    transition: background .1s;
}
.plan-arvore-kit-item:last-child { border-bottom: none; }
.plan-arvore-kit-item:hover { background: #fafafa; }
.plan-arvore-kit-item-sel { background: #fff7ed !important; }
.plan-arvore-kit-cod  { color: #6b7280; flex-shrink: 0; white-space: nowrap; }
.plan-arvore-kit-content {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem;
}
.plan-arvore-kit-main {
    display: flex; align-items: center; gap: .3rem; min-width: 0;
}
.plan-arvore-kit-desc {
    flex: 1; min-width: 0; color: #374151;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
}
.plan-arvore-kit-qtd  {
    color: #fff; background: #64748b; border-radius: 10px;
    font-size: .62rem; font-weight: 700;
    padding: 1px 6px; flex-shrink: 0; white-space: nowrap;
}
.plan-arvore-kit-item-sel .plan-arvore-kit-qtd { background: #e8722a; }
.plan-arvore-kit-qtd-parcial { background: #d97706 !important; }

/* Linha única quando o kit tem apenas 1 item */
.plan-arvore-kit-item-solo {
    padding-left: 0;
}
.plan-arvore-kit-codigo-prefix {
    font-size: .6rem; font-weight: 700; color: #e8722a;
    letter-spacing: .02em; flex-shrink: 0; white-space: nowrap;
    padding-right: .2rem;
}

/* Modo "Só Kit" — linha única com código e descrição do kit */
.plan-arvore-kit-so {
    display: flex; align-items: center; gap: .35rem;
    padding: .2rem .3rem; font-size: .65rem;
    border-bottom: 1px solid #f1f5f9; border-radius: 3px;
    transition: background .1s;
}
.plan-arvore-kit-so:last-child { border-bottom: none; }
.plan-arvore-kit-so:hover { background: #fafafa; }
.plan-arvore-kit-so-cod {
    font-weight: 700; color: #e8722a;
    flex-shrink: 0; white-space: nowrap;
}
.plan-arvore-kit-so-desc {
    flex: 1; min-width: 0; color: #374151;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-arvore-kit-so-cnt {
    color: #fff; background: #64748b; border-radius: 10px;
    font-size: .6rem; font-weight: 700;
    padding: 1px 6px; flex-shrink: 0; white-space: nowrap;
}

/* Grupo de materiais na árvore */
.plan-arvore-mat-grupo { margin-top: .15rem; }
.plan-arvore-mat-grupo-hdr {
    display: flex; align-items: center; gap: .3rem;
    padding: .2rem .4rem .15rem 1.5rem;
    background: #f8fafc; border-top: 1px solid #e2e8f0;
    margin-top: .1rem;
}
.plan-arvore-mat-grupo-label { font-size: .62rem; color: #94a3b8; }
.plan-arvore-mat-item { padding-left: 1rem; }
.plan-arvore-mat-item .plan-arvore-kit-main { gap: .3rem; }
.plan-arvore-kit-sub {
    display: flex; align-items: center; gap: .25rem;
    font-size: .65rem; color: #3b82f6; padding-left: .05rem;
}
.plan-arvore-kit-sub-label {
    flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #3b82f6;
}

/* Checkboxes na árvore */
.arv-check {
    appearance: none; -webkit-appearance: none;
    width: 14px; height: 14px; flex-shrink: 0;
    border: 1.5px solid #cbd5e1; border-radius: 3px;
    background: #fff; cursor: pointer; transition: all .12s;
    position: relative; margin: 0;
}
.arv-check:checked {
    background: #e8722a; border-color: #e8722a;
}
.arv-check:checked::after {
    content: ""; position: absolute;
    left: 3px; top: 0px; width: 5px; height: 9px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(45deg);
}
.arv-check:hover:not(:checked) { border-color: #e8722a; }
.arv-check-sm { width: 11px; height: 11px; }
.arv-check-sm:checked::after { left: 2px; top: 0; width: 4px; height: 7px; }

/* Highlight de itens selecionados */
.plan-arvore-sel { background: #fff7f2 !important; }
.plan-arvore-kit-item-sel { background: #fff7f2; border-radius: 3px; }
.plan-arvore-kit-item-exec { opacity: .55; }
.plan-arvore-kit-item-exec .arv-check { cursor: not-allowed; }
.agend-conflito-aviso {
    display: flex; align-items: flex-start; gap: .4rem;
    font-size: .73rem; color: #92400e;
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px;
    padding: .35rem .6rem; flex-shrink: 0; line-height: 1.4; max-width: 340px;
}
.agend-conflito-aviso i { color: #d97706; margin-top: .1rem; flex-shrink: 0; }

/* Painel Avanço por Kit */
.plan-avanco-panel {
    margin: .35rem .35rem 0;
    border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; overflow: hidden;
    flex-shrink: 0;
    max-height: 40vh; overflow-y: auto;
}
.plan-avanco-toggle {
    width:100%; display:flex; align-items:center; gap:.5rem;
    padding:.55rem .75rem; background:none; border:none;
    font-size:.78rem; font-weight:600; color:#334155;
    cursor:pointer; text-align:left;
}
.plan-avanco-toggle:hover { background:#f8fafc; }
.plan-avanco-chevron { margin-left:auto; font-size:.65rem; color:#94a3b8; }
.plan-avanco-loading { padding:.75rem; text-align:center; font-size:.75rem; color:#94a3b8; }
.plan-avanco-vazio   { padding:.5rem .75rem; font-size:.75rem; color:#94a3b8; margin:0; }
.plan-avanco-geral {
    display:flex; align-items:center; gap:.5rem;
    padding:.4rem .75rem .3rem; background:#f8fafc;
    border-top:1px solid #e2e8f0; border-bottom:1px solid #e2e8f0;
    font-size:.72rem;
}
.plan-avanco-geral-label { font-weight:700; color:#1e2d4a; }
.plan-avanco-geral-pct   { font-weight:700; color:#e8722a; }
.plan-avanco-geral-valor { color:#64748b; margin-left:auto; }
.plan-avanco-list { padding:.4rem .5rem .5rem; display:flex; flex-direction:column; gap:.45rem; }
.plan-avanco-item { }
.plan-avanco-item-hdr {
    display:flex; align-items:baseline; gap:.35rem;
    font-size:.7rem; margin-bottom:.2rem;
}
.plan-avanco-kit-nome { font-weight:700; color:#1e2d4a; flex-shrink:0; }
.plan-avanco-kit-desc { color:#64748b; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.plan-avanco-pct { font-weight:700; color:#e8722a; flex-shrink:0; }
.plan-avanco-pct-done { color:#16a34a; }
.plan-avanco-bar-bg {
    height:7px; background:#e2e8f0; border-radius:4px; overflow:hidden;
}
.plan-avanco-bar-fill {
    height:100%; background:#e8722a; border-radius:4px;
    transition:width .3s ease;
}
.plan-avanco-bar-done { background:#16a34a; }
.plan-avanco-item-ftr {
    display:flex; justify-content:space-between;
    font-size:.64rem; color:#94a3b8; margin-top:.18rem;
}

/* Barra de seleção */
.plan-selecao-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .45rem .75rem; margin: .25rem .5rem .5rem;
    background: #fff3ed; border: 1px solid #fed7aa;
    border-radius: 8px; gap: .5rem;
}
.plan-selecao-info { display: flex; gap: .5rem; font-size: .75rem; color: #92400e; flex-wrap: wrap; }
.plan-selecao-info strong { color: #c2410c; }
.plan-selecao-clear {
    border: none; background: transparent; color: #c2410c;
    cursor: pointer; padding: .15rem .3rem; border-radius: 4px; font-size: .72rem;
}
.plan-selecao-clear:hover { background: #fde8d5; }
.plan-selecao-kit-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .25rem .65rem; border-radius: 6px;
    border: 1.5px solid #e8722a; background: #e8722a;
    color: #fff; font-size: .72rem; font-weight: 700; cursor: pointer;
    transition: background .15s;
}
.plan-selecao-kit-btn:hover { background: #d4641f; }

.plan-prog-count-badge {
    background: #e8722a; color: #fff; font-size: .7rem; font-weight: 700;
    border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.plan-prog-busca-wrap {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .75rem; border-bottom: 1px solid #e2e8f0;
    background: #fff; flex-shrink: 0;
}
.plan-prog-busca-wrap i { color: #94a3b8; font-size: .8rem; }
.plan-prog-busca {
    flex: 1; border: none; outline: none; font-size: .8rem; color: #1e2d4a; background: transparent;
}
.plan-prog-vazio { padding: 1.5rem 1rem; font-size: .82rem; color: #94a3b8; }

/* Cards */
.plan-prog-cards { flex: 1; overflow-y: auto; padding: .5rem; }
.plan-prog-card {
    background: #fff; border-radius: 10px; padding: .85rem;
    margin: .5rem; border: 1px solid #e2e8f0;
    transition: border-color .15s, box-shadow .15s;
}
.plan-prog-card-ativo { border-color: #e8722a; box-shadow: 0 0 0 2px rgba(232,114,42,.15); }
.plan-prog-card:hover { border-color: #cbd5e1; }
.plan-prog-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.plan-prog-equipe { font-size: .82rem; font-weight: 700; color: #1e2d4a; }
.plan-prog-data { font-size: .75rem; color: #94a3b8; margin-bottom: .5rem; }
.plan-prog-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .78rem; color: #64748b; margin-bottom: .2rem;
}
.plan-prog-row strong { color: #1e2d4a; }
.plan-prog-mat-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .78rem; color: #64748b; margin: .35rem 0;
}
.plan-prog-mat-badge {
    font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}
.mat-nao-solicitado { background: #1e2d4a; color: #fff; }
.mat-solicitado     { background: #eff6ff; color: #1d4ed8; }
.mat-recebido       { background: #f0fdf4; color: #16a34a; }
.plan-prog-situ {
    font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.situ-programada { background: #eff6ff; color: #2563eb; }
.situ-executada  { background: #f0fdf4; color: #16a34a; }
.situ-suspensa   { background: #fffbeb; color: #d97706; }
.situ-cancelada  { background: #fef2f2; color: #dc2626; }
.plan-prog-obs { font-size: .72rem; color: #94a3b8; margin: .25rem 0; font-style: italic; }
.plan-prog-actions { display: flex; gap: .35rem; margin-top: .5rem; }
.plan-prog-btn {
    background: #f1f5f9; border: none; border-radius: 5px; padding: .25rem .45rem;
    cursor: pointer; color: #475569; font-size: .68rem;
}
.plan-prog-btn:hover { background: #e2e8f0; }
.plan-prog-btn-del:hover { background: #fef2f2; color: #dc2626; }

/* Modal de planejamento */
.plan-modal { width: 520px; max-width: 95vw; }
.plan-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
    margin-top: .75rem;
}
.plan-form-group { display: flex; flex-direction: column; gap: .3rem; }
.plan-form-group label { font-size: .72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.plan-form-full { grid-column: 1 / -1; }

/* ── Modal Programar Execução ─────────────────────────────────────────────── */
.plan-agend-btn {
    background: #3b82f6; color: #fff; border: none; border-radius: 6px;
    padding: .3rem .75rem; font-size: .75rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
    transition: background .15s;
}
.plan-agend-btn:hover:not(:disabled) { background: #2563eb; }
.plan-agend-btn:disabled { opacity: .45; cursor: not-allowed; }

.agend-modal {
    background: #fff; border-radius: 14px; padding: 0;
    width: 860px; max-width: 96vw; max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    overflow: hidden;
}
.agend-modal-cols {
    display: flex; gap: 0; flex: 1; overflow: hidden;
    border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0;
}
.agend-col {
    display: flex; flex-direction: column; overflow: hidden;
    border-right: 1px solid #e2e8f0;
    padding: 1rem;
}
.agend-col:last-child { border-right: none; }
.agend-col-itens   { flex: 1.1; min-width: 0; }
.agend-col-equipes { flex: 1.2; min-width: 0; }
.agend-col-periodo { flex: 1.1; min-width: 0; }

.agend-col-titulo {
    font-size: .7rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: .6rem;
}

/* Itens */
.agend-itens-lista { overflow-y: auto; flex: 1; }
.agend-grupo-titulo {
    font-size: .72rem; font-weight: 700; color: #1e2d4a;
    padding: .3rem 0 .15rem; margin-top: .35rem;
    border-bottom: 1px solid #f1f5f9;
}
.agend-item-row {
    display: flex; align-items: center; gap: .4rem; padding: .25rem 0;
    font-size: .76rem;
}
.agend-item-desc { flex: 1; min-width: 0; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agend-item-qtd  { color: #64748b; font-size: .72rem; flex-shrink: 0; }

/* Equipes */
.agend-equipes-lista { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.agend-equipe-item {
    display: flex; align-items: flex-start; gap: .5rem; padding: .5rem .6rem;
    border-radius: 7px; cursor: pointer; border: 1.5px solid transparent;
    transition: background .12s, border-color .12s;
}
.agend-equipe-item:hover { background: #f8fafc; border-color: #e2e8f0; }
.agend-equipe-sel  { background: #eff6ff; border-color: #bfdbfe; }
.agend-equipe-radio { font-size: .9rem; color: #3b82f6; flex-shrink: 0; margin-top: 1px; }
.agend-equipe-info { display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.agend-equipe-info strong { font-size: .8rem; color: #1e2d4a; }
.agend-equipe-info span   { font-size: .7rem; color: #64748b; }
/* Info button */
.agend-eq-info-btn {
    background: none; border: none; cursor: pointer; padding: 0 2px;
    color: #94a3b8; font-size: .7rem; line-height: 1; flex-shrink: 0;
    transition: color .15s;
}
.agend-eq-info-btn:hover { color: #3b82f6; }

/* Equipe Info Modal */
.eq-info-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .15s ease;
}
.eq-info-modal {
    background: #fff; border-radius: 14px; width: 420px; max-width: 96vw;
    max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.22); overflow: hidden;
    animation: slideUp .18s ease;
}
.eq-info-hdr {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 1rem 1.1rem .75rem; border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, #1e2d4a 0%, #2a3f65 100%);
}
.eq-info-hdr-nome { font-size: 1rem; font-weight: 700; color: #fff; }
.eq-info-hdr-sub  { font-size: .75rem; color: rgba(255,255,255,.55); margin-top: 2px; }
.eq-info-hdr .modal-close { color: rgba(255,255,255,.5); font-size: .85rem; }
.eq-info-hdr .modal-close:hover { color: #fff; }
.eq-info-body { overflow-y: auto; padding: .75rem 1.1rem 1rem; display: flex; flex-direction: column; gap: .8rem; }
.eq-info-section { display: flex; flex-direction: column; gap: .4rem; }
.eq-info-sec-titulo {
    font-size: .72rem; font-weight: 700; color: #475569; text-transform: uppercase;
    letter-spacing: .04em; display: flex; align-items: center; gap: .35rem;
}
.eq-info-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.eq-info-chip {
    font-size: .72rem; padding: .2rem .55rem; border-radius: 20px;
    background: #f1f5f9; color: #475569; white-space: nowrap;
}
.eq-info-bar-area { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .3rem; }
.eq-info-bar-track {
    flex: 1; height: 10px; background: #e2e8f0; border-radius: 6px; overflow: hidden;
}
.eq-info-bar-pct { font-size: .7rem; font-weight: 600; white-space: nowrap; }
.eq-info-rows { display: flex; flex-direction: column; gap: 2px; }
.eq-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: 2px 0; }
.eq-info-row-lbl { font-size: .73rem; color: #64748b; }
.eq-info-row-val  { font-size: .73rem; color: #1e2d4a; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.eq-info-row-calc .eq-info-row-lbl { color: #475569; }
.eq-info-row-calc .eq-info-row-val { color: #1e2d4a; }
.eq-info-row-sub  .eq-info-row-lbl { font-size: .7rem; padding-left: .6rem; color: #94a3b8; }
.eq-info-row-sub  .eq-info-row-val { font-size: .7rem; color: #64748b; }
.eq-info-row-saldo { border-top: 1px solid #f1f5f9; padding-top: 4px; margin-top: 2px; }
.eq-info-row-saldo .eq-info-row-lbl { font-size: .73rem; font-weight: 600; }
.eq-info-pos .eq-info-row-lbl, .eq-info-pos .eq-info-row-val { color: #16a34a; }
.eq-info-neg .eq-info-row-lbl, .eq-info-neg .eq-info-row-val { color: #dc2626; }
@keyframes slideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.agend-eq-sat { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.agend-eq-sat-row { display: flex; align-items: center; gap: 4px; }
.agend-eq-sat-lbl { font-size: .6rem; font-weight: 600; color: #64748b; width: 14px; flex-shrink: 0; }
.agend-eq-sat-track { flex: 1; height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.agend-eq-sat-val { font-size: .6rem; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Saturação redesenhada */
.aeq-sat-row   { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.aeq-sat-lbl   { font-size: .6rem; font-weight: 700; color: #94a3b8; width: 14px; flex-shrink: 0; }
.aeq-sat-track { flex: 1; height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; display: flex; }
.aeq-sat-pct   { font-size: .65rem; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }
.aeq-ok   { color: #16a34a; }
.aeq-warn { color: #d97706; }
.aeq-full { color: #dc2626; }

/* Mini-timeline por equipe */
.aeq-timeline  { display: flex; gap: 2px; margin-top: 5px; flex-wrap: wrap; }
.aeq-day       { width: 14px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.aeq-day-free  { background: #e2e8f0; }
.aeq-day-ocp   { background: #e8722a; opacity: .85; }
.aeq-day-hoje  { outline: 2px solid #eab308; outline-offset: 1px; }

/* Período */
.agend-periodo-inputs { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.agend-periodo-inputs label { font-size: .72rem; color: #64748b; margin-bottom: 1px; }
.agend-cal-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .78rem; font-weight: 600; color: #1e2d4a;
    margin: .4rem 0; padding: .2rem 0;
}
.agend-cal-nav {
    background: none; border: none; cursor: pointer; color: #64748b;
    padding: .2rem .35rem; border-radius: 4px; font-size: .78rem;
}
.agend-cal-nav:hover { background: #f1f5f9; }
.agend-mini-cal { width: 100%; border-collapse: collapse; font-size: .72rem; }
.agend-mini-cal th {
    text-align: center; color: #94a3b8; font-weight: 600;
    padding: 2px 1px; font-size: .65rem;
}
.agend-mini-cal td {
    text-align: center; padding: 3px 1px;
    border-radius: 4px; min-width: 26px;
}
.agend-dia-ocupado { background: #f1f5f9; color: #94a3b8 !important; }
.agend-dia-sel { background: #dbeafe; color: #1d4ed8 !important; font-weight: 600; }
.agend-dia-ocupado.agend-dia-sel { background: #bfdbfe; }
.agend-cal-legenda {
    font-size: .68rem; color: #94a3b8; margin-top: .4rem;
    display: flex; align-items: center; gap: .3rem;
}
.agend-dia-ocupado-dot {
    display: inline-block; width: 10px; height: 10px;
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 2px;
}
.agend-cal-hint { font-size: .75rem; color: #94a3b8; margin-top: .5rem; font-style: italic; }

/* Footer */
.agend-modal-footer {
    display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem;
    flex-wrap: wrap;
}
.agend-obs-wrap { flex: 1; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.agend-obs-wrap label { font-size: .72rem; color: #64748b; white-space: nowrap; }
.agend-obs-wrap .form-input { flex: 1; min-width: 0; }
.agend-footer-btns { display: flex; gap: .5rem; flex-shrink: 0; }

/* Badge de agendamento na árvore */
.plan-agend-badge {
    font-size: .65rem; font-weight: 600; color: #065f46;
    background: #d1fae5; border-radius: 5px; padding: 1px 4px 1px 6px;
    flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: .25rem;
}
.plan-agend-badge-del {
    background: none; border: none; cursor: pointer; padding: 0 2px;
    font-size: .75rem; line-height: 1; color: #047857; opacity: .6; border-radius: 3px;
}
.plan-agend-badge-del:hover { opacity: 1; background: #a7f3d0; }

/* ── Painel de Programação (sobre o mapa, sidebar fica intacta) ── */
.agend-panel {
    position: absolute; inset: 0; z-index: 20;
    background: #fff;
    display: flex; flex-direction: column;
    animation: agendPanelIn .18s ease-out;
}
@keyframes agendPanelIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.agend-panel-hdr {
    display: flex; align-items: center; gap: .6rem;
    padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0; background: #fff;
}
.agend-panel-titulo { font-size: .9rem; font-weight: 800; color: #1e293b; flex: 1; }
.agend-panel-badge {
    font-size: .72rem; font-weight: 600;
    background: #fef3c7; color: #d97706;
    padding: 2px 9px; border-radius: 20px;
}
.agend-obra-ctx {
    display: flex; flex-wrap: wrap; gap: .35rem;
    padding: .45rem 1rem; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc; flex-shrink: 0;
}
.agend-obra-ctx-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .7rem; font-weight: 600; color: #475569;
    border: 1px solid #cbd5e1; border-radius: 20px;
    padding: 2px 8px; background: #fff; white-space: nowrap;
}
.agend-obra-ctx-chip i { font-size: .65rem; }
.agend-obra-ctx-rota { color: #2563eb !important; border-color: #93c5fd !important; background: #eff6ff !important; }
.agend-panel-body {
    display: grid; grid-template-columns: 270px 1fr;
    flex: 1; overflow: hidden; min-height: 0;
}
.agend-panel-proj {
    border-right: 1px solid #e2e8f0; background: #f8fafc;
    display: flex; flex-direction: column;
    overflow-y: auto; padding: .9rem;
}
.agend-panel-eq {
    display: flex; flex-direction: column;
    overflow-y: auto; padding: .9rem;
}
.agend-panel-col-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #94a3b8;
    display: flex; align-items: center; gap: .35rem;
    margin-bottom: .6rem;
}
.agend-ctx-sep { color: #cbd5e1; font-size: .8rem; padding: 0 2px; align-self: center; }
.agend-ctx-filter { cursor: pointer !important; transition: all .12s !important; }
.agend-ctx-filter:hover { background: #f1f5f9 !important; border-color: #94a3b8 !important; }
.agend-ctx-filter-on { background: #1e2d4a !important; color: #fff !important; border-color: #1e2d4a !important; }
.agend-panel-ftr {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 1rem; border-top: 1px solid #e2e8f0;
    background: #f8fafc; flex-shrink: 0; flex-wrap: wrap;
}
/* Projeção — left column */
.agend-proj-eq-nome { font-size: .82rem; font-weight: 700; color: #1e293b; }
.agend-proj-eq-meta { font-size: .72rem; color: #64748b; margin-top: 1px; }
.agend-proj-cap {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .6rem; padding: .45rem .6rem;
    background: #eff6ff; border-radius: 6px;
}
.agend-proj-cap-val { font-size: 1rem; font-weight: 800; color: #2563eb; }
.agend-proj-cap-sub { font-size: .65rem; color: #64748b; }
.agend-proj-items { display: flex; flex-direction: column; gap: .15rem; }
.agend-proj-grupo-label {
    font-size: .7rem; font-weight: 700; color: #e8722a;
    margin: .5rem 0 .2rem; text-transform: uppercase; letter-spacing: .03em;
}
.agend-proj-item {
    display: flex; align-items: center; gap: .35rem;
    font-size: .72rem; padding: .15rem 0;
}
.agend-proj-item-desc { flex: 1; min-width: 0; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agend-proj-item-qtd  { color: #94a3b8; font-size: .68rem; flex-shrink: 0; }
.agend-proj-item-ignorado { opacity: .65; }
.agend-proj-item-ignorado-tag {
    font-size: .6rem; color: #92400e; background: #fef3c7;
    border: 1px solid #fcd34d; border-radius: 10px;
    padding: 0 5px; flex-shrink: 0; white-space: nowrap;
}
.agend-proj-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex: 1;
    color: #94a3b8; font-size: .78rem; gap: .5rem; text-align: center;
}
.agend-proj-empty i { font-size: 1.3rem; }
/* Breakdown de jornada */
.agend-proj-breakdown { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.agend-proj-brow {
    display: grid; grid-template-columns: 8px 1fr 44px auto;
    align-items: center; gap: .4rem; font-size: .72rem;
}
.agend-proj-brow-total { border-top: 1px solid #e2e8f0; padding-top: .35rem; margin-top: .1rem; }
.agend-proj-brow-dot  { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.agend-proj-brow-lbl  { color: #64748b; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agend-proj-brow-bar  { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.agend-proj-brow-val  { font-size: .7rem; font-weight: 600; text-align: right; white-space: nowrap; color: #475569; }
/* Caixa financeira na projeção */
.agend-proj-fin-box {
    margin-top: .5rem;
    padding: .45rem .55rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
}
.agend-proj-fin-hdr {
    font-size: .65rem; font-weight: 700; color: #166534;
    text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: .35rem;
}
.agend-proj-fin-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .7rem; margin-bottom: .2rem;
}
.agend-proj-fin-lbl { color: #64748b; }
.agend-proj-fin-val { font-weight: 600; color: #1e293b; }
.agend-proj-fin-bar-track {
    height: 5px; background: #d1fae5; border-radius: 3px;
    overflow: hidden; margin-top: .35rem;
}

/* Footer — período inline */
.agend-ftr-label { font-size: .78rem; font-weight: 700; color: #475569; white-space: nowrap; flex-shrink: 0; }
.agend-ftr-date-group { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.agend-ftr-date-lbl { font-size: .72rem; color: #94a3b8; white-space: nowrap; }
.agend-ftr-date { font-size: .78rem !important; padding: .3rem .45rem !important; width: 130px; }
.agend-ftr-dias { font-size: .72rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
/* ── Date picker customizado ── */
.agend-dp-trigger { cursor: pointer; user-select: none; }
.agend-dp-trigger:hover { background: #f1f5f9 !important; }
.agend-dp-backdrop { position: fixed; inset: 0; z-index: 1000; }
.agend-dp-popup {
    position: fixed; bottom: 68px; left: 200px;
    width: 252px; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px; box-shadow: 0 -4px 24px rgba(0,0,0,.15); z-index: 1001;
}
.agend-dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.agend-dp-nav-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: #475569; padding: 2px 8px; border-radius: 4px; line-height: 1; }
.agend-dp-nav-btn:hover { background: #f1f5f9; }
.agend-dp-nav-lbl { font-size: .82rem; font-weight: 700; color: #1e293b; text-transform: capitalize; }
.agend-dp-dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.agend-dp-dow > div { text-align: center; font-size: .62rem; font-weight: 700; color: #94a3b8; padding: 2px 0; }
.agend-dp-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.agend-dp-day { text-align: center; font-size: .78rem; padding: 5px 2px; border-radius: 5px; cursor: pointer; color: #1e293b; }
.agend-dp-day:hover { background: #f1f5f9; }
.dp-sel { background: #1e2d4a !important; color: #fff !important; font-weight: 700; }
.dp-hoje { font-weight: 700; color: #e8722a; }
.dp-outro { color: #cbd5e1; }
.dp-disabled { color: #d1d5db !important; cursor: default; pointer-events: none; }
.dp-disabled:hover { background: transparent !important; }
.dp-range { background: #e8f0fb; border-radius: 0; }

/* ── Abas ── */
.agend-abas {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.agend-aba {
    padding: .52rem 1.1rem;
    font-size: .78rem; font-weight: 600; color: #64748b;
    background: none; border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    display: flex; align-items: center; gap: .35rem;
    transition: .12s; font-family: inherit;
}
.agend-aba:hover { color: #1e293b; }
.agend-aba.ativo { color: #2563eb; border-bottom-color: #2563eb; }
.agend-aba i { font-size: .72rem; }

/* ── Campos extras (OC/OS/Planejamento/Condições/Turno/Intervenção) ── */
.agend-panel-extra {
    padding: .75rem 1rem;
    background: #fff;
    flex: 1;
    overflow-y: auto;
}
.agend-extra-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem .6rem;
}
.agend-extra-span2 { grid-column: span 2; }
.agend-extra-fg { display: flex; flex-direction: column; gap: .15rem; }
.agend-extra-fg > label { font-size: .67rem; font-weight: 600; color: #475569; }
.agend-extra-fg .form-input { font-size: .75rem; padding: .3rem .45rem; }
.agend-extra-ta { min-height: 110px; resize: vertical; font-family: inherit; }
.agend-extra-slbl {
    font-size: .67rem; font-weight: 800; color: #64748b;
    text-transform: uppercase; letter-spacing: .04em;
    padding: .4rem 0 .25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: .4rem;
    display: flex; align-items: center; gap: .25rem;
}
.agend-extra-cond {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .45rem .6rem;
    margin-bottom: .1rem;
}
/* Toggle Não/Sim */
.agend-tgl { display: flex; gap: .2rem; }
.agend-tgl-btn {
    padding: .2rem .55rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: .68rem; font-weight: 600; color: #64748b;
    transition: .12s; font-family: inherit;
}
.agend-tgl-btn.agend-tgl-sim { background: #16a34a; border-color: #16a34a; color: #fff; }
.agend-tgl-btn.agend-tgl-nao { background: #e2e8f0; border-color: #e2e8f0; color: #475569; }
.agend-req { color: #dc2626; font-size: .7rem; }
.agend-campo-inv { border-color: #dc2626 !important; background: #fef2f2 !important; }
.agend-tgl-inv { outline: 2px solid #dc2626; border-radius: 7px; }
/* Turno */
.agend-turno-btns { display: flex; gap: .2rem; }
.agend-turno-btn {
    flex: 1; padding: .25rem;
    border: 1.5px solid #e2e8f0; border-radius: 6px;
    background: #fff; cursor: pointer;
    font-size: .68rem; font-weight: 600; color: #64748b;
    transition: .12s; font-family: inherit; text-align: center;
}
.agend-turno-btn.ativo { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ── Catálogo autocomplete ─────────────────────────────────────────────────── */
.cat-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}
.cat-dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .8rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.cat-dropdown-item:last-child { border-bottom: none; }
.cat-dropdown-item:hover { background: #f8fafc; }
.btn-importar-mat { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.btn-importar-mat:hover { background: #bbf7d0; }
.btn-importar-serv { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.btn-importar-serv:hover { background: #bfdbfe; }

/* ── Busca Global (navbar) ─────────────────────────────────────────────────── */
.gsearch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}
.gsearch-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
    width: 640px;
    max-width: 95vw;
    overflow: hidden;
}
.gsearch-input-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}
.gsearch-icon { color: #94a3b8; font-size: .95rem; flex-shrink: 0; }
.gsearch-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #0f172a;
    background: transparent;
}
.gsearch-input::placeholder { color: #94a3b8; }

.usuarios-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}

/* Quando .gsearch-input-wrap é usado fora do modal de busca global,
   precisa de fundo/borda explícitos para ficar visível sobre páginas claras. */
.usuarios-busca {
  max-width: 38rem;
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.usuarios-busca:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
}
.usuarios-busca .gsearch-input { color: #0f172a; }
.usuarios-busca .gsearch-input::placeholder { color: #64748b; }
.usuarios-busca .fa-search { color: #94a3b8; }

.usuarios-resumo {
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .8rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .usuarios-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .usuarios-busca {
    max-width: none;
  }

  .usuarios-resumo {
    white-space: normal;
  }
}
.gsearch-clear {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: .8rem; padding: .2rem;
}
.gsearch-clear:hover { color: #475569; }
.gsearch-esc {
    font-size: .68rem; padding: .2rem .4rem;
    background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 4px; color: #94a3b8;
    flex-shrink: 0;
}
.gsearch-results { max-height: 380px; overflow-y: auto; }
.gsearch-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background .1s;
}
.gsearch-item:hover, .gsearch-item-ativo { background: #f8fafc; }
.gsearch-codigo { font-weight: 700; color: #e8722a; font-size: .88rem; min-width: 90px; }
.gsearch-tipo   { font-size: .8rem; color: #475569; flex: 1; }
.gsearch-mun    { font-size: .8rem; color: #64748b; min-width: 110px; }
.gsearch-status { font-size: .75rem; color: #94a3b8; min-width: 100px; }
.gsearch-arrow  { color: #cbd5e1; font-size: .75rem; margin-left: auto; }
.gsearch-item:hover .gsearch-arrow, .gsearch-item-ativo .gsearch-arrow { color: #e8722a; }
.gsearch-vazio, .gsearch-hint {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.5rem 1.1rem;
    color: #94a3b8;
    font-size: .88rem;
}

/* ============================================================
   OBRA PROGRAMAR — Protótipo marcadores no canvas
   ============================================================ */

/* Layout principal */
.prog-page {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: calc(100vh - var(--nav-height) - 24px - 2.5rem);
    margin-top: calc(var(--nav-height) + 24px);
    gap: 0;
    overflow: hidden;
}

/* ── Canvas ── */
.prog-canvas-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.prog-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.prog-canvas-titulo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: #1e293b;
}

.prog-canvas-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: .1rem .5rem;
    font-size: .7rem;
    font-weight: 500;
    color: #64748b;
}

.prog-canvas {
    flex: 1;
    position: relative;
    cursor: crosshair;
    overflow: hidden;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 39px, #e2e8f0 39px, #e2e8f0 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, #e2e8f0 39px, #e2e8f0 40px),
        #f8fafc;
}

.prog-canvas-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    pointer-events: none;
    color: #94a3b8;
    text-align: center;
    font-size: .85rem;
}

/* Marcadores */
.prog-marcador {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #16a34a;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: transform .15s, background .15s;
    z-index: 10;
}

.prog-marcador span {
    color: white;
    font-size: .7rem;
    font-weight: 700;
}

.prog-marcador:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.prog-marcador-ativo {
    background: #2563eb;
    transform: translate(-50%, -50%) scale(1.15);
}

/* ── Sidebar ── */
.prog-sidebar {
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prog-sidebar-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.prog-sidebar-titulo {
    font-weight: 700;
    font-size: .9rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.prog-badge {
    background: #3b82f6;
    color: white;
    border-radius: 999px;
    padding: .05rem .4rem;
    font-size: .7rem;
    font-weight: 700;
}

.prog-sidebar-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 2rem 1rem;
    color: #94a3b8;
    text-align: center;
    font-size: .82rem;
}

/* Cards */
.prog-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .75rem .85rem;
    margin: .5rem .75rem 0;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.prog-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.prog-card-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .4rem;
    margin-bottom: .2rem;
}

.prog-card-equipe {
    font-size: .8rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.3;
}

.prog-card-pg {
    font-size: .68rem;
    background: #f1f5f9;
    border-radius: 4px;
    padding: .1rem .35rem;
    color: #64748b;
    flex-shrink: 0;
}

.prog-card-data {
    font-size: .72rem;
    color: #64748b;
    margin-bottom: .25rem;
}

.prog-card-sit {
    color: #3b82f6;
    font-weight: 500;
}

.prog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .4rem;
}

.prog-card-mat {
    font-size: .65rem;
    border-radius: 4px;
    padding: .1rem .35rem;
    font-weight: 600;
}

.prog-mat-nao { background: #fef3c7; color: #d97706; }
.prog-mat-ok  { background: #dcfce7; color: #16a34a; }

.prog-card-del {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .2rem .3rem;
    border-radius: 4px;
    font-size: .75rem;
    transition: color .15s;
}
.prog-card-del:hover { color: #dc2626; }

/* ── Detalhe ── */
.prog-detalhe {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
}

.prog-det-info {
    margin-bottom: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #f1f5f9;
}

.prog-det-equipe {
    font-weight: 700;
    font-size: .88rem;
    color: #1e293b;
}

.prog-det-sub {
    font-size: .72rem;
    color: #64748b;
    margin-top: .15rem;
}

.prog-det-form {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .75rem;
}

.prog-det-form label {
    font-size: .72rem;
    font-weight: 600;
    color: #374151;
}

.prog-det-form select,
.prog-det-form textarea {
    width: 100%;
    padding: .4rem .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: .8rem;
    color: #1e293b;
    background: white;
    resize: vertical;
    font-family: inherit;
}

.prog-det-form select:focus,
.prog-det-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.prog-det-meta {
    background: #f8fafc;
    border-radius: 8px;
    padding: .6rem .75rem;
    margin-bottom: .75rem;
}

.prog-det-meta-hdr {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: #374151;
    margin-bottom: .35rem;
}

.prog-meta-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.prog-meta-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width .4s ease;
}

.prog-det-secao {
    margin-bottom: .75rem;
}

.prog-det-secao-titulo {
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .4rem;
}

/* Pacotes grid */
.prog-pacotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: .4rem;
}

.prog-pacote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .5rem .3rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: .62rem;
    color: #374151;
    font-family: inherit;
    transition: border-color .15s, background .15s;
    text-align: center;
}

.prog-pacote-btn i {
    font-size: 1.1rem;
    color: #64748b;
}

.prog-pacote-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}

.prog-pacote-btn:hover i { color: #2563eb; }

/* Tabela serviços */
.prog-serv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .72rem;
    color: #374151;
}

.prog-serv-table th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: .3rem .25rem;
}

.prog-serv-table td {
    padding: .35rem .25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.prog-serv-del {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .15rem .3rem;
    border-radius: 4px;
    font-size: .75rem;
}
.prog-serv-del:hover { color: #dc2626; }

/* Busca serviço */
.prog-busca-drop {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.prog-busca-item {
    display: flex;
    gap: .5rem;
    padding: .45rem .65rem;
    cursor: pointer;
    font-size: .78rem;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
}

.prog-busca-item:last-child { border-bottom: none; }
.prog-busca-item:hover { background: #f8fafc; }

.prog-busca-cod {
    font-size: .68rem;
    background: #f1f5f9;
    border-radius: 3px;
    padding: .05rem .3rem;
    color: #64748b;
    flex-shrink: 0;
}

/* ── Modais ── */
.prog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.prog-modal {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.prog-modal-pacote { max-width: 620px; }

.prog-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    font-size: .92rem;
    color: #1e293b;
}

.prog-modal-hdr button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .2rem;
    font-size: .9rem;
}

.prog-modal-sub {
    font-size: .72rem;
    color: #94a3b8;
    padding: .35rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.prog-modal-body {
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.prog-modal-body label {
    font-size: .75rem;
    font-weight: 600;
    color: #374151;
}

.prog-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .75rem 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Equipe dropdown no modal */
.prog-equipe-drop {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
}

.prog-equipe-item {
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.prog-equipe-item:hover { background: #f8fafc; }
.prog-equipe-item strong { font-size: .82rem; color: #1e293b; }
.prog-equipe-item span   { font-size: .7rem;  color: #64748b; }

/* Pacote table */
.prog-pacote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.prog-pacote-table th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: .4rem .35rem;
}

.prog-pacote-table td {
    padding: .4rem .35rem;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.prog-qtd-input {
    width: 75px;
    padding: .3rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .8rem;
    text-align: right;
}

.prog-qtd-input:focus { outline: none; border-color: #3b82f6; }

/* Inputs comuns */
.prog-input {
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .82rem;
    color: #1e293b;
    font-family: inherit;
    background: white;
}

.prog-input:focus { outline: none; border-color: #3b82f6; }

/* Botões */
.prog-btn-voltar {
    display: flex;
    align-items: center;
    gap: .3rem;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: .3rem .6rem;
    font-size: .75rem;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
}

.prog-btn-voltar:hover { background: #e2e8f0; }

.prog-btn-salvar {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: .45rem .75rem;
    font-size: .8rem;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .25rem;
    align-self: flex-start;
}

.prog-btn-salvar:hover { background: #2563eb; }

.prog-btn-add {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: .45rem .7rem;
    font-size: .78rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.prog-btn-add:hover { background: #2563eb; }

.prog-btn-cancelar {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .5rem 1rem;
    font-size: .82rem;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
}

.prog-btn-cancelar:hover { background: #e2e8f0; }

.prog-btn-confirmar {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.1rem;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.prog-btn-confirmar:hover { background: #1d4ed8; }

/* Toast */
.prog-toast {
    position: fixed;
    top: calc(var(--nav-height) + 32px);
    right: 1.5rem;
    z-index: 9000;
    background: #16a34a;
    color: white;
    border-radius: 10px;
    padding: .6rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: slideIn .2s ease;
}

.prog-toast button {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    padding: 0 .2rem;
    font-size: .85rem;
}

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

/* ── Botão Gantt ── */
.btn-gantt {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .18rem .55rem; font-size: .68rem; font-weight: 600;
    color: #475569; border: 1px solid #e2e8f0; border-radius: 5px;
    background: #fff; cursor: pointer; transition: .12s; font-family: inherit;
}
.btn-gantt:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }

/* ── Gantt inline panel ── */
.gantt-panel {
    position: absolute; inset: 0; z-index: 25;
    background: #f8fafc; display: flex; flex-direction: column;
    overflow: hidden; animation: agendPanelIn .18s ease-out;
}
.gantt-hdr {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem 1rem; border-bottom: 1px solid #e2e8f0;
    background: #fff; flex-shrink: 0;
}
.gantt-back {
    display: inline-flex; align-items: center; gap: .3rem;
    background: #f1f5f9; border: 1px solid #cbd5e1;
    color: #475569; border-radius: 5px; cursor: pointer; padding: .22rem .6rem;
    font-size: .76rem; font-weight: 600; font-family: inherit;
}
.gantt-back:hover { background: #e2e8f0; color: #1e293b; }
.gantt-titulo { font-size: .85rem; font-weight: 800; color: #1e293b; display: flex; align-items: center; gap: .4rem; }
.gantt-titulo i { color: #e8722a; }
/* Filter buttons */
.gantt-filter { display: flex; gap: .25rem; margin-left: .5rem; }
.gantt-filter-btn {
    background: #f1f5f9; border: 1px solid #cbd5e1;
    color: #64748b; border-radius: 5px; cursor: pointer;
    padding: .18rem .55rem; font-size: .72rem; font-weight: 600; font-family: inherit;
}
.gantt-filter-btn:hover { background: #e2e8f0; color: #1e293b; }
.gantt-filter-btn.ativo { background: #e8722a; border-color: #e8722a; color: #fff; }
.gantt-filter-dom { margin-left: 4px; border-left: 1px solid #cbd5e1; }
.gantt-filter-dom.ativo { background: #1e2d4a; border-color: #1e2d4a; color: #fff; }
.gantt-base-select {
    background: #f8fafc; border: 1px solid #cbd5e1;
    color: #475569; border-radius: 5px; cursor: pointer;
    padding: .18rem .45rem; font-size: .72rem; font-weight: 500; font-family: inherit;
    outline: none; max-width: 160px;
}
.gantt-base-select option { background: #fff; color: #1e293b; }
.gantt-filtro-obra {
    display: inline-flex; align-items: center; gap: .3rem;
    background: #f8fafc; border: 1px solid #cbd5e1;
    border-radius: 5px; padding: .12rem .45rem;
    margin-left: .35rem;
}
.gantt-filtro-obra i.fa-search { color: #94a3b8; font-size: .7rem; }
.gantt-filtro-obra input {
    border: none; outline: none; background: transparent;
    font-size: .72rem; font-family: inherit; color: #1e293b;
    width: 140px; padding: 2px 0;
}
.gantt-filtro-obra input::placeholder { color: #94a3b8; }
.gantt-filtro-clear {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; padding: 0 2px; font-size: .7rem;
}
.gantt-filtro-clear:hover { color: #ef4444; }
/* Nav */
.gantt-nav { display: flex; align-items: center; gap: .45rem; }
.gantt-nav-btn {
    background: #f1f5f9; border: 1px solid #cbd5e1;
    color: #475569; border-radius: 5px; cursor: pointer; padding: .22rem .5rem; font-size: .75rem;
}
.gantt-nav-btn:hover { background: #e2e8f0; color: #1e293b; }
.gantt-mes-lbl { font-size: .8rem; font-weight: 700; color: #1e293b; min-width: 120px; text-align: center; text-transform: capitalize; }
.gantt-loading { flex: 1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .88rem; gap: .5rem; }
/* Body: table + optional detail panel */
.gantt-body { flex: 1; display: flex; overflow: hidden; }
.gantt-scroll { flex: 1; overflow: auto; }
/* Table */
.gantt-table { border-collapse: collapse; min-width: max-content; width: 100%; }
.gantt-table thead { position: sticky; top: 0; z-index: 10; }
.gantt-eq-th {
    position: sticky; left: 0; z-index: 20; background: #f8fafc;
    padding: .45rem .75rem; text-align: left; font-size: .7rem; font-weight: 700; color: #475569;
    min-width: 160px; border-bottom: 2px solid #e2e8f0; border-right: 2px solid #e2e8f0;
}
.gantt-eq-th--compact { min-width: 120px !important; }
.gantt-day-th {
    background: #f8fafc; padding: .3rem .15rem; text-align: center; min-width: 34px;
    font-size: .62rem; color: #64748b; border-bottom: 2px solid #e2e8f0; border-right: 1px solid #f1f5f9;
}
.gantt-day-th--wide { min-width: 64px; }
.gantt-dow { color: #94a3b8; font-size: .58rem; margin-bottom: 1px; letter-spacing: .02em; }
.gantt-dnum { font-size: .74rem; font-weight: 700; }
.gantt-dom { background: #f1f5f9 !important; }
.gantt-hoje { background: #fef9c3 !important; }
.gantt-hoje .gantt-dnum { color: #d97706; }
.gantt-sel-hdr { background: #dbeafe !important; }
/* Body rows */
.gantt-eq-td {
    position: sticky; left: 0; z-index: 5; background: #fff;
    padding: .3rem .5rem .3rem .75rem; font-size: .74rem; font-weight: 600; color: #1e293b;
    border-bottom: 1px solid #f1f5f9; border-right: 2px solid #e2e8f0;
    min-width: 160px;
}
.gantt-eq-td--compact { min-width: 130px; }
.gantt-eq-cell { display: flex; flex-direction: column; gap: .05rem; width: 100%; }
.gantt-eq-cell-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gantt-eq-nome { font-size: .73rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-eq-tipo { font-size: .6rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-eq-info-btn {
    flex-shrink: 0; background: none; border: none; padding: .15rem .2rem;
    cursor: pointer; color: #cbd5e1; font-size: .8rem; border-radius: 4px; line-height: 1;
}
.gantt-eq-info-btn:hover { background: #fff3eb; color: #e8722a; }
.gantt-table tbody tr:hover .gantt-eq-td,
.gantt-table tbody tr:hover .gantt-cell { background: #f8fafc; }
.gantt-cell {
    padding: .2rem .1rem; border-bottom: 1px solid #f8fafc; border-right: 1px solid #f1f5f9;
    vertical-align: middle; min-width: 34px; height: 34px;
}
.gantt-cell-dom { background: #f1f5f9 !important; }
.gantt-cell-hoje { background: #fef9c3 !important; }
.gantt-cell-parada {
    background: repeating-linear-gradient(
        -45deg, #fff7ed, #fff7ed 4px, #fed7aa 4px, #fed7aa 8px) !important;
    cursor: pointer; padding: .2rem .25rem;
}
.gantt-cell-parada:hover { background: #fed7aa !important; }
.gantt-parada-bar {
    font-size: .6rem; font-weight: 700; color: #c2410c;
    display: flex; align-items: center; gap: 3px;
    padding: 1px 2px; white-space: nowrap; overflow: hidden;
}
.gantt-cell-pendente { background: #fefce8 !important; }
.gantt-pendente-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #eab308; display: block; margin: auto;
}
.gantt-ctx-btn {
    display: flex; align-items: center; gap: .5rem;
    width: 100%; padding: .6rem .75rem; background: none; border: none;
    font-size: .82rem; font-weight: 500; color: var(--text); cursor: pointer;
    border-radius: 6px; text-align: left;
}
.gantt-ctx-btn:hover { background: var(--surface-hover); }
.gantt-ctx-btn--parada { color: #ea580c; }
.gantt-ctx-btn--parada:hover { background: #fff7ed; }

/* ── Gantt context menu ──────────────────────────────────────── */
.gantt-ctx-menu {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .22), 0 6px 18px rgba(15, 23, 42, .10);
    width: 420px;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    animation: ctx-pop .12s ease;
}
@keyframes ctx-pop {
    from { transform: scale(.94); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.gantt-ctx-header {
    padding: 1.1rem 1.15rem .95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.gantt-ctx-equipe {
    font-size: 1rem; font-weight: 800; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .35rem;
}
.gantt-ctx-data {
    font-size: .86rem; color: #64748b;
    display: flex; align-items: center; gap: .3rem;
}
.gantt-ctx-separator { height: 1px; background: #f1f5f9; }
.gantt-ctx-action {
    display: flex; align-items: center; gap: .75rem;
    width: 100%; padding: 1rem 1.1rem; background: none; border: none;
    cursor: pointer; text-align: left; transition: background .12s;
}
.gantt-ctx-action:hover { background: #f8fafc; }
.gantt-ctx-action:not(:last-child) { border-bottom: 1px solid #f8fafc; }
.gantt-ctx-action-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.gantt-ctx-action-icon--blue   { background: #eff6ff; color: #2563eb; }
.gantt-ctx-action-icon--orange { background: #fff7ed; color: #ea580c; }
.gantt-ctx-action-text { display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.gantt-ctx-action-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.gantt-ctx-action-desc  { font-size: .84rem; color: #94a3b8; line-height: 1.35; }
.gantt-ctx-chevron { font-size: .85rem; color: #cbd5e1; flex-shrink: 0; }

.gantt-busca-obra-modal {
    width: min(680px, calc(100vw - 2rem));
    max-width: 680px;
}

.gantt-cell-ocup { cursor: pointer; padding: .2rem .25rem; }
.gantt-cell-ocup--prog { background: #eff6ff; }
.gantt-cell-ocup--exec { background: #fffbeb; }
.gantt-cell-ocup--done { background: #f0fdf4; }
.gantt-cell-ocup:hover { background: #dbeafe !important; }
.gantt-cell-selecionada { background: #dbeafe !important; }

/* Gantt — múltiplos agendamentos empilhados na mesma célula */
.gantt-cell-multi { padding: 0 !important; background: transparent !important; vertical-align: top; }
.gantt-cell-multi:hover { background: transparent !important; }
.gantt-sub {
    cursor: pointer; padding: .1rem .2rem .15rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    display: flex; flex-direction: column; gap: 2px;
    min-height: 30px;
}
.gantt-sub:last-child { border-bottom: none; }
.gantt-sub--prog { background: #eff6ff; }
.gantt-sub--exec { background: #fffbeb; }
.gantt-sub--done { background: #f0fdf4; }
.gantt-sub:hover { background: #dbeafe; }
.gantt-sub-selecionada { background: #dbeafe !important; }
.gantt-sub .gantt-cell-top { min-height: 0; padding: .1rem .15rem 0; }
.gantt-sub .gantt-stacked-bar { flex-shrink: 0; border-radius: 3px; }
/* Gantt bar inside occupied cell */
/* Gantt cell — novo layout com barra empilhada */
.gantt-cell-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: .25rem; padding: .15rem .2rem .1rem;
    min-height: 20px;
}
.gantt-cell-cod {
    font-size: .65rem; font-weight: 700; color: #1e40af;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.gantt-cell-vals {
    display: flex; align-items: center; gap: .3rem; flex-shrink: 0;
}
.gantt-cell-val-prog {
    font-size: .6rem; font-weight: 600; color: #64748b; white-space: nowrap;
}
.gantt-cell-val-exec {
    font-size: .6rem; font-weight: 600; color: #16a34a; white-space: nowrap;
}
.gantt-stacked-bar {
    height: 6px; display: flex; width: 100%;
    background: #e2e8f0; border-radius: 0 0 3px 3px; overflow: hidden;
}
.gantt-stacked-exec { background: #16a34a; height: 100%; transition: width .3s; }
.gantt-stacked-prog { background: #f59e0b; height: 100%; transition: width .3s; }

/* ── Gantt summary bar ──────────────────────────────────────── */
.gantt-summary-bar {
    display: flex; gap: .6rem; padding: .5rem .85rem;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.gantt-sum-card {
    display: flex; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 9px;
    padding: .4rem .75rem; flex: 1;
}
.gantt-sum-content { display: flex; flex-direction: column; }
.gantt-sum-val { font-size: .8rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.gantt-sum-lbl { font-size: .6rem; color: #94a3b8; }
.gantt-sum-warn { color: #b45309; }
.gantt-sum-mini-bar { height: 3px; background: #f1f5f9; border-radius: 2px; overflow: hidden; width: 40px; margin-left: auto; }
.gantt-sum-mini-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.gantt-sum-mini-fill.gantt-fin-ok { background: #22c55e; }
.gantt-sum-mini-fill.gantt-sum-warn { background: #f59e0b; }
.gantt-sum-mini-fill.gantt-fin-no { background: #ef4444; }

/* ── Equipe column enriched ─────────────────────────────────── */
.gantt-eq-top { display: flex; align-items: flex-start; gap: .3rem; width: 100%; }
.gantt-eq-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; cursor: default; }
.dot-idle { background: #cbd5e1; }
.dot-prog { background: #3b82f6; box-shadow: 0 0 0 2px #dbeafe; }
.dot-exec { background: #f59e0b; box-shadow: 0 0 0 2px #fef3c7; }
.dot-done { background: #22c55e; box-shadow: 0 0 0 2px #dcfce7; }
.gantt-eq-ocp-bar { height: 3px; background: #f1f5f9; border-radius: 2px; overflow: hidden; margin: .3rem 0 .15rem; width: 100%; }
.gantt-eq-ocp-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.ocp-ok   { background: #22c55e; }
.ocp-warn { background: #f59e0b; }
.ocp-no   { background: #ef4444; }
.gantt-eq-footer { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.gantt-eq-ocp-lbl { font-size: .58rem; color: #94a3b8; }
.gantt-eq-fin { font-size: .6rem; font-weight: 600; }
.gantt-fin-warn { color: #b45309; }

/* Status badge no painel */
.gantt-status-badge {
    display: inline-flex; align-items: center; padding: .15rem .55rem;
    border-radius: 10px; font-size: .68rem; font-weight: 700;
}
.gantt-status-prog { background: #dbeafe; color: #1d4ed8; }
.gantt-status-exec { background: #fef3c7; color: #b45309; }
.gantt-status-done { background: #dcfce7; color: #16a34a; }
.gantt-status-late { background: #fee2e2; color: #b91c1c; }
/* Progress bar no painel */
.gantt-det-progresso { margin-bottom: .5rem; }
.gantt-det-prog-bar { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; margin-bottom: 3px; }
.gantt-det-prog-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.gantt-det-prog-prog { background: #3b82f6; }
.gantt-det-prog-exec { background: #f59e0b; }
.gantt-det-prog-done { background: #22c55e; }
.gantt-det-prog-txt { font-size: .68rem; color: #64748b; }
/* Jornadas no painel */
.gantt-det-jornadas { margin-top: .6rem; display: flex; flex-direction: column; gap: .2rem; }
.gantt-det-jornada-row { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: #475569; }
.gantt-det-jornada-apr { background: #eff6ff; color: #3b82f6; border-radius: 8px; padding: .05rem .4rem; font-size: .62rem; font-weight: 600; margin-left: auto; }
.gantt-us-row { display: flex; align-items: center; gap: .25rem; margin-top: 2px; }
.gantt-us-val { font-size: .6rem; font-weight: 600; color: #475569; white-space: nowrap; }
.gantt-meta-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.gantt-meta-ok  { background: #22c55e; }
.gantt-meta-no  { background: #ef4444; }
/* Financial inline na célula */
.gantt-fin-val { font-weight: 700 !important; }
.gantt-fin-ok  { color: #16a34a !important; }
.gantt-fin-no  { color: #dc2626 !important; }
/* Financial section no painel */
.gantt-det-fin { display: flex; flex-direction: column; gap: .3rem; }
.gantt-det-fin-row { display: flex; gap: .5rem; }
.gantt-det-fin-item { display: flex; flex-direction: column; flex: 1; }
.gantt-det-fin-label { font-size: .6rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.gantt-det-fin-val { font-size: .82rem; font-weight: 700; color: #1e293b; }
.gantt-det-fin-pct { font-size: .72rem; font-weight: 600; display: flex; align-items: center; gap: .3rem; padding: .25rem .5rem; border-radius: 6px; }
.gantt-det-fin-pct.gantt-fin-ok { background: #f0fdf4; }
.gantt-det-fin-pct.gantt-fin-no { background: #fef2f2; }
/* ── Detail panel ────────────────────────────────────────────── */
.gantt-detalhe {
    width: 320px; flex-shrink: 0; border-left: 1px solid #e2e8f0;
    background: #f8fafc; display: flex; flex-direction: column; overflow: hidden;
}
.gantt-det-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem 1rem; border-bottom: 1px solid #e2e8f0; background: #fff;
}
.gantt-det-hdr-left { display: flex; align-items: center; gap: .5rem; }
.gantt-det-hdr-title { font-size: .8rem; font-weight: 700; color: #1e293b; }
.gantt-close {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    padding: .2rem .35rem; font-size: .82rem; border-radius: 4px; line-height: 1;
}
.gantt-close:hover { background: #f1f5f9; color: #475569; }
.gantt-det-body { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .6rem; }

/* Sections */
.gantt-det-section {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: .65rem .75rem; display: flex; flex-direction: column; gap: .45rem;
}
.gantt-det-sec-hdr {
    display: flex; align-items: center; gap: .35rem;
    font-size: .68rem; font-weight: 700; color: #475569; text-transform: uppercase;
    letter-spacing: .05em;
}

/* Progress stats row */
.gantt-det-prog-stats {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .7rem; color: #64748b;
}
.gantt-det-pct-prog { color: #3b82f6; font-weight: 700; }
.gantt-det-pct-exec { color: #f59e0b; font-weight: 700; }

/* Info cards grid */
.gantt-det-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.gantt-det-card { display: flex; flex-direction: column; gap: .1rem; }
.gantt-det-card-wide { grid-column: 1 / -1; }
.gantt-det-card-lbl { font-size: .6rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.gantt-det-card-val { font-size: .78rem; font-weight: 600; color: #1e293b; }
.gantt-det-card-sm  { font-size: .72rem; }
.gantt-det-obs { font-size: .72rem; color: #64748b; background: #f8fafc; border-radius: 6px; padding: .35rem .5rem; display: flex; gap: .35rem; align-items: flex-start; }

/* Financial redesign */
.gantt-det-fin2 { display: flex; flex-direction: column; gap: .4rem; }
.gantt-det-fin2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.gantt-det-fin2-item { display: flex; flex-direction: column; gap: .1rem; }
.gantt-det-fin2-lbl { font-size: .6rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.gantt-det-fin2-val { font-size: .85rem; font-weight: 700; color: #1e293b; }
.gantt-det-fin2-badge {
    display: flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600;
    border-radius: 7px; padding: .3rem .6rem;
}
.gantt-fin2-ok { background: #f0fdf4; color: #16a34a; }
.gantt-fin2-no { background: #fef2f2; color: #dc2626; }

/* Items section */
.gantt-det-itens-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.gantt-det-itens-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .65rem; font-weight: 600; border-radius: 20px; padding: .2rem .55rem;
}
.gantt-det-itens-chip.srv { background: #eff6ff; color: #2563eb; }
.gantt-det-itens-chip.mat { background: #fef3c7; color: #b45309; }
.gantt-det-itens-chip.kit { background: #ecfdf5; color: #047857; }

/* Linha por kit no painel lateral */
.gantt-det-kit-row {
    padding: .45rem 0; border-top: 1px solid #f1f5f9;
}
.gantt-det-kit-hdr-row {
    display: flex; align-items: center; gap: .4rem; flex-wrap: nowrap;
    font-size: .68rem; margin-bottom: .25rem;
}
.gantt-det-kit-ponto {
    display: inline-flex; align-items: center; gap: 3px;
    background: #1e2d4a; color: #fff; padding: 1px 7px; border-radius: 10px;
    font-size: .6rem; font-weight: 700; flex-shrink: 0;
}
.gantt-det-kit-ponto i { font-size: .55rem; }
.gantt-det-kit-cod {
    font-family: ui-monospace, monospace;
    font-size: .62rem; font-weight: 700; color: #047857;
    background: #ecfdf5; padding: 1px 6px; border-radius: 4px;
    flex-shrink: 0;
}
.gantt-det-kit-desc {
    font-size: .68rem; color: #1e293b; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-det-kit-cnt {
    font-size: .62rem; color: #64748b; font-weight: 600; flex-shrink: 0;
}
.gantt-det-kit-bar {
    height: 4px; background: #f1f5f9; border-radius: 2px; overflow: hidden;
}
.gantt-det-kit-bar-fill {
    height: 100%; background: #10b981; transition: width .2s;
}

/* Modal "Ver todos" — grupos por ponto e por kit */
.itens-modal-toggle {
    display: inline-flex; background: #f1f5f9; border-radius: 6px; padding: 2px;
}
.itens-modal-toggle button {
    background: none; border: none; cursor: pointer;
    font-size: .7rem; font-weight: 600; color: #64748b;
    padding: .25rem .6rem; border-radius: 4px;
    display: inline-flex; align-items: center; gap: .3rem;
}
.itens-modal-toggle button.ativo { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.itens-modal-toggle button i { font-size: .65rem; }

.itens-modal-ponto-grupo { margin-top: 1.1rem; }
.itens-modal-ponto-hdr {
    display: flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 700; color: #1e293b;
    padding: .4rem .55rem; background: #1e2d4a; color: #fff;
    border-radius: 6px;
}
.itens-modal-ponto-hdr i { font-size: .7rem; color: #e8722a; }
.itens-modal-ponto-cnt {
    margin-left: auto; font-size: .68rem; font-weight: 500;
    background: rgba(255,255,255,.12); padding: 1px 8px; border-radius: 10px;
}

.itens-modal-kit-grupo {
    margin: .55rem 0 .35rem .35rem;
    border-left: 3px solid #d1fae5; padding-left: .7rem;
}
.itens-modal-kit-grupo.aberto { border-left-color: #10b981; }
.itens-modal-kit-hdr {
    display: flex; align-items: center; gap: .45rem; width: 100%;
    background: none; border: none; cursor: pointer; text-align: left;
    padding: .35rem .25rem; font-size: .72rem; font-family: inherit;
    border-bottom: 1px dashed transparent;
    border-radius: 4px;
}
.itens-modal-kit-hdr:hover { background: #f8fafc; }
.itens-modal-kit-grupo.aberto .itens-modal-kit-hdr {
    border-bottom-color: #e2e8f0;
}
.itens-modal-kit-chev {
    font-size: .58rem; color: #94a3b8; width: 10px; flex-shrink: 0;
}
.itens-modal-expand-all {
    background: none; border: 1px solid #e2e8f0; border-radius: 5px;
    cursor: pointer; font-size: .68rem; font-weight: 600; color: #475569;
    padding: .25rem .55rem; display: inline-flex; align-items: center; gap: .35rem;
}
.itens-modal-expand-all:hover { background: #f8fafc; border-color: #cbd5e1; }
.itens-modal-expand-all i { font-size: .6rem; }
.itens-modal-kit-cod {
    font-family: ui-monospace, monospace;
    font-size: .68rem; font-weight: 700; color: #047857;
    background: #ecfdf5; padding: 2px 7px; border-radius: 4px;
}
.itens-modal-kit-desc { font-weight: 600; color: #1e293b; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itens-modal-kit-cnt {
    font-size: .65rem; font-weight: 600; color: #64748b;
    background: #f1f5f9; padding: 1px 7px; border-radius: 10px;
}

.itens-modal-tipo {
    width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
    font-size: .58rem; font-weight: 800; border-radius: 4px; flex-shrink: 0;
}
.itens-modal-tipo.srv { background: #dbeafe; color: #1d4ed8; }
.itens-modal-tipo.mat { background: #fef3c7; color: #b45309; }
.gantt-det-ver-todos {
    margin-left: auto; background: none; border: none; cursor: pointer;
    font-size: .65rem; font-weight: 600; color: #3b82f6; display: flex; align-items: center; gap: .25rem;
    padding: .1rem .25rem; border-radius: 4px;
}
.gantt-det-ver-todos:hover { background: #eff6ff; }
.gantt-det-item-row {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem 0; border-top: 1px solid #f1f5f9;
}
.gantt-det-item-icon {
    width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: .6rem;
}
.gantt-det-item-icon.srv { background: #eff6ff; color: #2563eb; }
.gantt-det-item-icon.mat { background: #fef3c7; color: #b45309; }
.gantt-det-item-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gantt-det-item-cod  { font-size: .62rem; font-weight: 700; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-det-item-desc { font-size: .67rem; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-det-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; flex-shrink: 0; }
.gantt-det-item-qtd  { font-size: .62rem; color: #64748b; white-space: nowrap; }
.gantt-det-mais {
    width: 100%; text-align: center; background: none; border: 1px dashed #cbd5e1;
    border-radius: 7px; padding: .3rem; font-size: .7rem; color: #64748b; cursor: pointer;
    margin-top: .1rem;
}
.gantt-det-mais:hover { background: #f8fafc; color: #475569; }

/* Jornadas */
.gantt-det-jornada-row { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: #475569; padding: .2rem 0; border-top: 1px solid #f1f5f9; }
.gantt-det-jornada-apr { background: #eff6ff; color: #3b82f6; border-radius: 8px; padding: .05rem .4rem; font-size: .62rem; font-weight: 600; margin-left: auto; }

/* Financial — separador e bloco mês */
.gantt-fin-bloco-lbl {
    font-size: .6rem; font-weight: 800; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: .1rem;
}
.gantt-fin-sep {
    height: 1px; background: #e2e8f0; margin: .2rem 0;
}
.gantt-fin-mes-hdr {
    display: flex; align-items: baseline; justify-content: space-between;
}
.gantt-fin-mes-sub { font-size: .62rem; color: #94a3b8; }
.gantt-fin-mes-bar-wrap {
    display: flex; align-items: center; gap: .5rem; margin-top: .15rem;
}
.gantt-fin-mes-track {
    flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden;
}
.gantt-fin-mes-prog {
    height: 100%; background: #93c5fd; border-radius: 4px;
    position: relative; transition: width .3s; min-width: 2px;
}
.gantt-fin-mes-prog.ok { background: #86efac; }
.gantt-fin-mes-exec {
    position: absolute; top: 0; left: 0; height: 100%;
    background: #22c55e; border-radius: 4px; transition: width .3s;
}
.gantt-fin-mes-pct { font-size: .68rem; font-weight: 700; width: 32px; text-align: right; flex-shrink: 0; }

/* Keep old classes for backward compat */
.gantt-det-row { display: flex; flex-direction: column; gap: .1rem; }
.gantt-det-lbl { font-size: .65rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.gantt-det-val { font-size: .78rem; font-weight: 600; color: #1e293b; }

/* ── Itens modal ───────────────────────────────────────────── */
.itens-modal-grupo { margin-top: 1rem; }
.itens-modal-grupo-hdr {
    display: flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; color: #475569; text-transform: uppercase;
    letter-spacing: .05em; padding-bottom: .45rem; border-bottom: 2px solid #e2e8f0; margin-bottom: .3rem;
}
.itens-modal-lista { display: flex; flex-direction: column; }
.itens-modal-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem 0; border-bottom: 1px solid #f1f5f9; font-size: .78rem;
}
.itens-modal-row:last-child { border-bottom: none; }
.itens-modal-ponto {
    background: #e8722a; color: #fff; font-size: .65rem; font-weight: 700;
    padding: 1px 6px; border-radius: 10px; flex-shrink: 0; white-space: nowrap;
}
.itens-modal-cod  { font-weight: 700; color: #1e293b; width: 90px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itens-modal-desc { flex: 1; color: #475569; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itens-modal-qtd  { font-weight: 600; color: #1e293b; width: 60px; flex-shrink: 0; text-align: right; white-space: nowrap; }
.itens-modal-acao { font-size: .68rem; color: #64748b; width: 50px; flex-shrink: 0; text-align: center;
    background: #f8fafc; border-radius: 4px; padding: .1rem .3rem; }

/* ============================================================
   ALMOXARIFADO
   ============================================================ */

/* Toolbar (filters + search row) */
.almox-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.almox-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
}

/* KPI cards */
.almox-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.almox-kpi {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.almox-kpi-valor {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}
.almox-kpi-label {
    font-size: .78rem;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 500;
}

/* Alert row (stock below minimum) */
.almox-alerta td {
    background: #fef2f2 !important;
    color: #991b1b;
}
.almox-alerta td:first-child {
    box-shadow: inset 3px 0 0 #ef4444;
}

/* Multi-item list in modals */
.almox-item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.almox-item-row {
    display: grid;
    grid-template-columns: 1fr 120px 36px;
    gap: 8px;
    align-items: center;
}

/* Category badge */
.almox-cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Priority badges */
.almox-prioridade {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.almox-pri-baixa    { background: #f1f5f9; color: #64748b; }
.almox-pri-normal   { background: #eff6ff; color: #2563eb; }
.almox-pri-alta     { background: #fef3c7; color: #b45309; }
.almox-pri-urgente  { background: #fef2f2; color: #dc2626; }

/* Status badges (extend badge-status) */
.almox-st-pendente      { background: #fef3c7; color: #b45309; }
.almox-st-aprovada      { background: #dcfce7; color: #16a34a; }
.almox-st-em-andamento  { background: #dbeafe; color: #2563eb; }
.almox-st-em-transito   { background: #dbeafe; color: #2563eb; }
.almox-st-concluida     { background: #d1fae5; color: #059669; }
.almox-st-rejeitada     { background: #fef2f2; color: #dc2626; }
.almox-st-cancelada     { background: #f1f5f9; color: #64748b; }
.almox-st-entregue      { background: #fef3c7; color: #b45309; }
.almox-st-parcial       { background: #dbeafe; color: #2563eb; }
.almox-st-devolvido     { background: #dcfce7; color: #16a34a; }

/* ============================================================
   BOLETIM DE EQUIPES
   ============================================================ */
.bol-page {
    padding-bottom: 2rem;
}
.bol-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.bol-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.bol-titulo i { color: var(--primary); }
.bol-data-hoje {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    background: #fff3eb;
    padding: .3rem .8rem;
    border-radius: 20px;
}
.bol-loading, .bol-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    gap: .75rem;
    font-size: .95rem;
}
.bol-vazio i { font-size: 2.5rem; opacity: .35; }

/* Grid de cards */
.bol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Card */
.bol-card {
    background: var(--surface);
    border-radius: var(--r-md);
    overflow: hidden;
    color: var(--text);
    box-shadow: var(--shadow-1); border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.bol-card-clickable {
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}
.bol-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.bol-card-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-base);
    letter-spacing: .02em;
    color: var(--text);
}
.bol-card-header i { color: var(--primary); }
.bol-cp-header-right {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

/* Tabela de performance */
.bol-perf {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--border);
}
.bol-perf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.bol-perf-table thead th {
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.bol-perf-table thead th:first-child { text-align: left; }
.bol-unidade {
    font-size: .62rem;
    font-weight: 400;
    color: var(--text-muted);
}
.bol-perf-table tbody td {
    padding: .35rem 0;
    text-align: center;
    vertical-align: middle;
}
.bol-row-label {
    text-align: left !important;
    font-size: .8rem;
    color: var(--text-2);
    white-space: nowrap;
}
.bol-val {
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
    margin-right: .2rem;
}
.bol-val-zero { color: var(--text-muted); font-weight: 400; }

.bol-arrow-green  { color: var(--success); font-size: .8rem; }
.bol-arrow-red    { color: var(--danger); font-size: .8rem; }
.bol-arrow-yellow { color: var(--warning); font-size: .8rem; }

/* Data do turno */
.bol-turno-data {
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
    padding: .5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.bol-platform-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1.25rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: .74rem;
}
.bol-platform-line span {
    color: var(--text-2);
}
.bol-platform-line strong {
    margin-left: auto;
    font-size: .72rem;
}
.bol-platform-line.ok {
    background: var(--success-bg);
}
.bol-platform-line.ok i,
.bol-platform-line.ok strong {
    color: var(--success);
}
.bol-platform-line.pending {
    background: var(--warning-bg);
}
.bol-platform-line.pending i,
.bol-platform-line.pending strong {
    color: var(--warning);
}

/* Veículo + Líder */
.bol-info-row {
    display: flex;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.bol-veiculo-bloco, .bol-lider-bloco {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 90px;
}
.bol-label-sec {
    font-size: .65rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .07em;
}
.bol-placa-tag {
    display: inline-block;
    background: var(--gray-100);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
    padding: .25rem .65rem;
    border-radius: 8px;
    letter-spacing: .04em;
}
.bol-placa-vazio { color: var(--text-muted); font-size: .8rem; }

/* Avatar */
.bol-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.bol-avatar-sm {
    width: 30px;
    height: 30px;
    font-size: .65rem;
}

.bol-membro-mini {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.bol-membro-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.bol-membro-nome {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bol-membro-cargo {
    font-size: .65rem;
    color: var(--text-muted);
}

/* Status badges */
.bol-status {
    font-size: .7rem;
    font-weight: 700;
    align-self: flex-start;
    margin-top: .15rem;
}
.bol-status-titular    { color: var(--success); }
.bol-status-substituto { color: var(--warning); }
.bol-status-falta      { color: var(--danger); }

/* Componentes */
.bol-componentes {
    padding: .85rem 1.25rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}
.bol-comp-lista {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: .25rem;
}
.bol-comp-row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.bol-comp-falta { opacity: .6; }

@media (max-width: 640px) {
    .bol-grid { grid-template-columns: 1fr; }
}

/* Filtro por base */
.bol-filtro-bases {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
}
.bol-base-btn {
    padding: .3rem .9rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.bol-base-btn:hover { border-color: var(--primary); color: var(--primary); }
.bol-base-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Card sem turno */
.bol-card-sem-turno { opacity: .6; }
.bol-card-sem-turno .bol-card-header,
.bol-card-sem-turno .bol-card-compact-header { background: var(--gray-200); }

.bol-sem-turno-badge {
    font-size: .62rem;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--text-2);
    border-radius: 4px;
    padding: .1rem .4rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.bol-turno-sem { color: var(--text-muted) !important; }

/* Membros inativos (sem turno) */
.bol-cp-membro-inativo { opacity: .7; }
.bol-dot-inativo { background: var(--gray-200); }

/* Boletim — controles de modo */
.bol-header-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.bol-modo-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .85rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.bol-modo-btn:hover { border-color: var(--primary); color: var(--primary); }
.bol-modo-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── PAINEL compacto ─────────────────────────────────────── */
.bol-grid-painel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .75rem;
}
.bol-card-compact {
    background: var(--surface);
    border-radius: var(--r-md);
    overflow: hidden;
    color: var(--text);
    box-shadow: var(--shadow-1); border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    font-size: .78rem;
}
.bol-card-compact-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: .5rem .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-weight: var(--fw-semibold);
    font-size: .82rem;
    color: var(--text);
}
.bol-card-compact-header span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bol-cp-placa {
    background: var(--gray-100);
    color: var(--text-2);
    border-radius: 5px;
    padding: .1rem .5rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.bol-compact-body {
    padding: .6rem .85rem .7rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}

/* Tabela prog/exec compacta */
.bol-cp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .76rem;
}
.bol-cp-table thead th {
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-bottom: .25rem;
    text-align: center;
}
.bol-cp-table thead th:first-child { text-align: left; }
.bol-cp-table tbody td {
    padding: .18rem 0;
    text-align: center;
    font-weight: 700;
    color: var(--text);
}
.bol-cp-row-lbl {
    text-align: left !important;
    font-weight: 500;
    color: var(--text-muted);
    font-size: .72rem;
    white-space: nowrap;
}
.bol-cp-zero { color: var(--text-muted) !important; font-weight: 400 !important; }

/* Líder */
.bol-cp-lider {
    display: flex;
    align-items: center;
    gap: .4rem;
    border-top: 1px solid var(--border);
    padding-top: .45rem;
    flex-wrap: wrap;
}
.bol-cp-sec {
    font-size: .62rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}
.bol-cp-lider-nome {
    font-size: .76rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bol-cp-badge {
    font-size: .62rem;
    font-weight: 700;
    flex-shrink: 0;
}
.bol-cp-badge.bol-status-titular    { color: var(--success); }
.bol-cp-badge.bol-status-substituto { color: var(--warning); }
.bol-cp-badge.bol-status-falta      { color: var(--danger); }

/* Lista de membros */
.bol-cp-membros {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    border-top: 1px solid var(--border);
    padding-top: .45rem;
}
.bol-cp-membro {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.bol-cp-falta { opacity: .55; }
.bol-cp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bol-dot-titular  { background: var(--success); }
.bol-dot-sub      { background: var(--warning); }
.bol-dot-falta    { background: var(--danger); }
.bol-cp-membro-nome {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .74rem;
    color: var(--text-2);
}


/* ============================================================
   CENTRAL DE OPERAÇÕES — Gestão à Vista  (tema Dracula)
   ============================================================ */

/* Paleta — mesma cor da navbar (#28293a)
   bg page   : #28293a   card     : #32344a
   inner     : #21222e   border   : #44475a
   fg        : #f8f8f2   muted    : #6272a4
   green     : #50fa7b   cyan     : #8be9fd
   orange    : #ffb86c   red      : #ff5555
   purple    : #bd93f9   yellow   : #f1fa8c
*/

/* ── Central de Operações (cop-*) ─────────────────── */
.cop-refresh-btn  {
    background: #f1f5f9; border: 1px solid var(--border); color: #475569;
    border-radius: 7px; padding: .3rem .55rem; cursor: pointer; font-size: .8rem;
}
.cop-refresh-btn:hover { background: #e2e8f0; }
.cop-now-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(120px, 1fr));
    gap: .8rem;
    margin-bottom: .85rem;
}
.cop-now-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: .9rem 1rem;
    box-shadow: var(--shadow-1);
    min-height: 136px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.cop-now-card-primary    { border-top: 3px solid var(--primary); }
.cop-now-card-trabalhando{ border-top: 3px solid var(--info); }
.cop-now-card-rota       { border-top: 3px solid var(--warning); }
.cop-now-card-aguardando { border-top: 3px solid var(--neutral); }
.cop-now-card-base       { border-top: 3px solid var(--success); }
.cop-now-card-alerta     { border-top: 3px solid var(--danger); }
.cop-now-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
}
.cop-now-value {
    font-size: 2.15rem;
    line-height: 1;
    font-weight: var(--fw-bold);
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-top: .2rem;
}
.cop-now-value span {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 700;
    margin-left: .2rem;
}
.cop-now-subtitle {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    margin-top: .35rem;
}
.cop-now-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .45rem;
    margin-top: .75rem;
}
.cop-now-meta span {
    font-size: .69rem;
    font-weight: 700;
    color: #64748b;
    background: rgba(241,245,249,.92);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: .22rem .48rem;
}
.cop-support-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr) minmax(260px, .8fr);
    gap: .8rem;
    margin-bottom: .9rem;
}
.cop-support-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: .9rem 1rem;
    box-shadow: var(--shadow-1);
}
.cop-section-note {
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    margin-left: .55rem;
}
.cop-kpi-list {
    display: grid;
    gap: .55rem;
}
.cop-kpi-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.86);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .68rem .8rem;
}
.cop-kpi-list-row span {
    font-size: .75rem;
    color: #475569;
    font-weight: 600;
}
.cop-kpi-list-row strong {
    font-size: .95rem;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.cop-kpi-list-compact { gap: .45rem; }
.cop-finance-compact-value {
    font-size: 1.9rem;
    line-height: 1;
    font-weight: var(--fw-bold);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.cop-finance-compact-meta {
    margin-top: .45rem;
    font-size: .74rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.45;
}
.cop-hero-eyebrow {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 800;
    color: #64748b;
    margin-bottom: .75rem;
}
.cop-hero-value-muted {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 700;
    margin-left: .15rem;
}
.cop-hero-progress {
    margin-top: .45rem;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.cop-hero-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}
.cop-inline-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0;
}
.cop-inline-alert {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .7rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 700;
    color: #334155;
}
.cop-inline-alert-danger {
    background: #fff5f5;
    border-color: #fecaca;
    color: #b91c1c;
}
.cop-inline-alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #b45309;
}
.cop-inline-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.cop-teams-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(248,250,252,.96) 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(15,23,42,.04);
    overflow: hidden;
}
.cop-teams-table {
    display: grid;
}
.cop-teams-head,
.cop-team-row {
    display: grid;
    grid-template-columns: minmax(280px, 1.5fr) minmax(140px, .8fr) minmax(120px, .55fr) minmax(120px, .55fr);
    gap: .9rem;
    align-items: center;
}
.cop-teams-head {
    padding: .8rem 1rem .7rem;
    background: linear-gradient(90deg, rgba(30,45,74,.96) 0%, rgba(45,55,72,.96) 100%);
    color: rgba(255,255,255,.72);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.cop-team-row {
    padding: .9rem 1rem;
    border-left: 4px solid #94a3b8;
    border-top: 1px solid #eef2f7;
}
.cop-team-cell-main {
    min-width: 0;
}
.cop-team-name-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.cop-team-name {
    font-size: .93rem;
    color: #0f172a;
}
.cop-team-name-link {
    color: inherit;
    text-decoration: none;
}
.cop-team-name-link:hover .cop-team-name,
.cop-team-name-link:hover strong {
    color: var(--primary);
}
.cop-team-obra {
    font-size: .68rem;
    font-weight: 700;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: .18rem .45rem;
}
.cop-team-subline {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .7rem;
    margin-top: .35rem;
    color: #64748b;
    font-size: .72rem;
}
.cop-team-cell-status {
    display: flex;
    align-items: center;
}
.cop-team-cell-metric {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.cop-team-metric-label {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #94a3b8;
}
.cop-team-cell-metric strong {
    font-size: 1.02rem;
    line-height: 1;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.cop-team-cell-metric small {
    font-size: .69rem;
    color: #64748b;
}
.cop-fleet-shell {
    background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(248,250,252,.96) 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(15,23,42,.04);
    padding: 1rem;
}
.cop-fleet-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: .8rem;
}
.cop-fleet-chip {
    border-radius: 14px;
    padding: .75rem .85rem;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.cop-fleet-chip span {
    display: block;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: .25rem;
}
.cop-fleet-chip strong {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}
.cop-fleet-chip-base { background: var(--surface); border-top: 3px solid var(--success); }
.cop-fleet-chip-rota { background: var(--surface); border-top: 3px solid var(--warning); }
.cop-fleet-chip-trabalho { background: var(--surface); border-top: 3px solid var(--info); }
.cop-fleet-chip-aguardo { background: var(--surface); border-top: 3px solid var(--neutral); }
.cop-fleet-table-wrap {
    overflow-x: auto;
}
.cop-fleet-table {
    min-width: 760px;
}
.cop-fleet-head,
.cop-fleet-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .8fr) minmax(100px, .55fr) minmax(110px, .55fr) minmax(90px, .45fr);
    gap: .8rem;
    align-items: center;
}
.cop-fleet-head {
    padding: .2rem .1rem .6rem;
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.cop-fleet-row {
    padding: .8rem .1rem;
    border-top: 1px solid #eef2f7;
}
.cop-fleet-team {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.cop-fleet-team strong {
    font-size: .86rem;
    color: #0f172a;
}
.cop-fleet-team span,
.cop-fleet-col-muted {
    font-size: .74rem;
    color: #64748b;
}
.cop-fleet-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .26rem .55rem;
    white-space: nowrap;
}
.cop-fleet-foot {
    margin-top: .6rem;
    font-size: .7rem;
    color: #94a3b8;
    font-weight: 600;
}
.cop-eq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
}
.cop-eq-card {
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,250,252,.95) 100%);
    border: 1px solid var(--border);
    border-left: 4px solid #94a3b8;
    border-radius: 14px;
    padding: .85rem .95rem;
}
.cop-eq-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: space-between;
}
.cop-eq-name {
    font-size: .92rem;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cop-eq-status {
    font-size: .68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .28rem .55rem;
    white-space: nowrap;
}
.cop-eq-subhead {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .7rem;
    margin-top: .35rem;
    color: #64748b;
    font-size: .72rem;
}
.cop-eq-plate {
    font-family: monospace;
    font-size: .69rem;
    color: #475569;
    background: #eef2f7;
    border-radius: 6px;
    padding: .12rem .38rem;
}
.cop-eq-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    margin-top: .7rem;
}
.cop-eq-metrics > div {
    background: rgba(255,255,255,.78);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .68rem .75rem;
}
.cop-eq-metric-label {
    display: block;
    font-size: .67rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: .35rem;
}
.cop-eq-metrics strong {
    display: block;
    font-size: 1.15rem;
    color: #0f172a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.cop-eq-metrics small {
    display: block;
    margin-top: .2rem;
    color: #64748b;
    font-size: .7rem;
}
.cop-clock-time { font-size: 1.15rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.cop-clock-date { font-size: .65rem; color: var(--text-muted); margin-top: .15rem; text-align: right; }
.cop-section-title {
    font-size: .72rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: .65rem; display: flex; align-items: center;
}
.cop-tipos-grid {
    display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: .25rem;
}
.cop-tipo-card {
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: .65rem .85rem; min-width: 110px; flex: 1;
}
.cop-tipo-card-val   { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.cop-tipo-card-total { font-size: .72rem; font-weight: 600; color: var(--text-muted); }
.cop-tipo-card-label { font-size: .65rem; color: var(--text-muted); margin: .15rem 0 .4rem; }
.cop-tipo-card-bar   { height: 4px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.cop-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; margin-right: .15rem; }
.cop-saude-items { display: flex; flex-direction: column; gap: .3rem; }
.cop-saude-item  { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text); }
.cop-saude-item strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.cop-bottom-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.cop-bottom-block { display: flex; flex-direction: column; }
.cop-bottom-block > .eq-table-wrap { flex: 1; }
.cop-chart-area { display: flex; align-items: flex-end; gap: .45rem; height: 90px; }
.cop-chart-col  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; height: 100%; justify-content: flex-end; }
.cop-chart-bars { display: flex; align-items: flex-end; flex: 1; width: 100%; justify-content: center; }
.cop-bar-real   { width: 14px; border-radius: 3px 3px 0 0; min-height: 3px; }
.cop-chart-label { font-size: .6rem; color: var(--text-muted); }
.cop-chart-val   { font-size: .62rem; font-weight: 700; }
.cop-ver-detalhes { margin-left:auto; font-size:.68rem; color:var(--primary); text-decoration:none; font-weight:600; letter-spacing:0; text-transform:none; }
.cop-ver-detalhes:hover { text-decoration:underline; }

@media (max-width: 1400px) {
    .cop-now-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .cop-now-card-primary {
        grid-column: 1 / -1;
    }
    .cop-support-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cop-support-card:first-child {
        grid-column: 1 / -1;
    }
    .cop-fleet-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cop-now-grid,
    .cop-support-grid,
    .cop-bottom-row,
    .cop-eq-grid {
        grid-template-columns: 1fr !important;
    }
    .cop-now-card-primary {
        grid-column: auto;
    }
    .cop-teams-head {
        display: none;
    }
    .cop-team-row {
        grid-template-columns: 1fr;
        gap: .55rem;
    }
    .cop-fleet-summary {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   GANTT — AÇÕES NO PAINEL DE DETALHE
   ══════════════════════════════════════════════════════════ */
.gantt-det-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
    padding: .6rem .75rem .75rem; border-top: 1px solid #e2e8f0;
}
.gantt-act-btn {
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .4rem .4rem; border-radius: 7px; font-size: .75rem; font-weight: 600;
    border: 1.5px solid; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.gantt-act-excluir { grid-column: 1 / -1; }
.gantt-act-editar  { color: #0891b2; border-color: #bae6fd; background: #f0f9ff; }
.gantt-act-editar:hover  { background: #e0f2fe; border-color: #7dd3fc; }
.gantt-act-reprog  { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.gantt-act-reprog:hover  { background: #ede9fe; border-color: #c4b5fd; }
.gantt-act-excluir { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.gantt-act-excluir:hover { background: #fee2e2; border-color: #fca5a5; }
.gantt-modal-erro  { font-size: .8rem; color: #dc2626; background: #fff5f5; border: 1px solid #fecaca;
    border-radius: 7px; padding: .45rem .75rem; margin: 0; display: flex; align-items: center; gap: .4rem; }
.gantt-modal-linkbtn { background: transparent; border: none; color: #1e40af; font-size: .7rem; font-weight: 600;
    cursor: pointer; padding: 0; text-decoration: underline; }
.gantt-modal-linkbtn:hover { color: #1e3a8a; }
.btn-excluir {
    padding: .48rem 1.1rem; background: #dc2626; color: #fff; border: none;
    border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer;
    display: flex; align-items: center; gap: .4rem; transition: background .15s;
}
.btn-excluir:hover:not(:disabled) { background: #b91c1c; }
.btn-excluir:disabled { opacity: .55; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   HISTÓRICO DE REPROGRAMAÇÕES
   ══════════════════════════════════════════════════════════ */
.repr-page { padding: 0 2rem 1.5rem; max-width: 1400px; margin: 0 auto; }
.repr-header { display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.repr-titulo { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin: 0;
    display: flex; align-items: center; gap: .5rem; }
.repr-titulo i { color: #e8722a; }
.repr-subtitulo { font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.repr-header-right { display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; }
.repr-filtro-wrap { position: relative; display: flex; align-items: center; }
.repr-filtro-icon { position: absolute; left: .7rem; color: #94a3b8; font-size: .8rem; }
.repr-filtro-input { padding: .42rem .75rem .42rem 2rem; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: .82rem; width: 280px; outline: none;
    transition: border-color .15s; }
.repr-filtro-input:focus { border-color: #e8722a; }
.repr-filtro-clear { position: absolute; right: .5rem; background: none; border: none;
    color: #94a3b8; cursor: pointer; font-size: .75rem; }
.repr-tipo-filtros { display: flex; gap: .35rem; }
.repr-tipo-btn { padding: .3rem .7rem; border-radius: 20px; font-size: .73rem; font-weight: 600;
    border: 1.5px solid #e2e8f0; background: #f8fafc; color: #64748b; cursor: pointer;
    transition: all .15s; }
.repr-tipo-btn.ativo, .repr-tipo-btn:hover { border-color: #e8722a; color: #e8722a; background: #fff7f4; }
.repr-f-edit.ativo   { border-color: #0891b2; color: #0891b2; background: #f0f9ff; }
.repr-f-reprog.ativo { border-color: #7c3aed; color: #7c3aed; background: #f5f3ff; }
.repr-f-del.ativo    { border-color: #dc2626; color: #dc2626; background: #fff5f5; }

.repr-loading, .repr-vazio { text-align: center; padding: 3rem; color: #94a3b8; font-size: .9rem; }
.repr-vazio i { font-size: 2rem; display: block; margin-bottom: .5rem; }

.repr-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.repr-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.repr-table thead th {
    background: #f8fafc; padding: .65rem .9rem; text-align: left;
    font-weight: 700; color: #64748b; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .04em; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.repr-table tbody .repr-row td { padding: .55rem .9rem; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; }
.repr-row:last-child td { border-bottom: none; }
.repr-row:hover td { background: #fafafa; }
.repr-row-excluido td { opacity: .75; }

.repr-td-data { white-space: nowrap; }
.repr-data { display: block; font-weight: 600; color: #1e293b; }
.repr-hora { display: block; font-size: .72rem; color: #94a3b8; }
.repr-td-id { font-weight: 700; color: #64748b; }
.repr-td-obra a.repr-link { color: #e8722a; font-weight: 700; text-decoration: none; }
.repr-td-obra a.repr-link:hover { text-decoration: underline; }
.repr-td-periodo { white-space: nowrap; font-size: .78rem; }
.repr-periodo-novo { color: #059669; font-weight: 600; }
.repr-td-usuario { font-size: .78rem; color: #475569; }
.repr-td-obs .repr-obs { display: block; max-width: 200px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; color: #475569; font-size: .78rem; }
.repr-eq-dest { color: #7c3aed; font-weight: 600; }
.repr-vazio-cell { color: #cbd5e1; }

.repr-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem;
    border-radius: 20px; font-size: .7rem; font-weight: 700; }
.repr-badge-editado    { background: #e0f2fe; color: #0369a1; }
.repr-badge-reprogramado { background: #ede9fe; color: #6d28d9; }
.repr-badge-excluido   { background: #fee2e2; color: #b91c1c; }

.repr-carregar-mais { text-align: center; padding: 1.2rem; }
.repr-mais-btn { padding: .5rem 1.5rem; border: 1.5px solid #e8722a; color: #e8722a;
    background: #fff7f4; border-radius: 8px; font-weight: 600; font-size: .83rem;
    cursor: pointer; transition: all .15s; }
.repr-mais-btn:hover:not(:disabled) { background: #e8722a; color: #fff; }
.repr-mais-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   GANTT — PAINEL EDITAR AGENDAMENTO (panel-style, igual agend-panel)
   ══════════════════════════════════════════════════════════ */
.gedit-panel-body {
    flex: 1; overflow: hidden; display: flex; flex-direction: column;
    padding: .75rem 1rem;
}
.gedit-grupos-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }

/* Busca */
.gedit-busca-wrap { position: relative; display: flex; align-items: center; }
.gedit-busca-icon { position: absolute; left: .6rem; color: #94a3b8; font-size: .78rem; }
.gedit-busca { width: 100%; padding: .38rem .75rem .38rem 1.9rem; border: 1.5px solid #e2e8f0;
    border-radius: 7px; font-size: .82rem; outline: none; box-sizing: border-box; }
.gedit-busca:focus { border-color: #e8722a; }
.gedit-busca-clear { position: absolute; right: .5rem; background: none; border: none;
    color: #94a3b8; cursor: pointer; font-size: .73rem; }

/* Grupos de kit */
.gedit-grupo { border: 1.5px solid #e2e8f0; border-radius: 9px; overflow: hidden; }
.gedit-grupo-ativo { border-color: #bae6fd; }
.gedit-grupo-hdr {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .75rem; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.gedit-grupo-ativo .gedit-grupo-hdr { background: #e0f2fe; border-bottom-color: #bae6fd; }
.gedit-grupo-check input { cursor: pointer; }
.gedit-grupo-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.gedit-grupo-kit  { font-size: .72rem; font-weight: 800; color: #e8722a;
    background: #fff7f4; border: 1px solid #fed7aa; border-radius: 4px; padding: .1rem .35rem; }
.gedit-grupo-desc { font-size: .78rem; font-weight: 600; color: #1e293b; }
.gedit-grupo-ponto { font-size: .7rem; color: #64748b; display: flex; align-items: center; gap: .2rem; }
.gedit-grupo-cnt  { font-size: .7rem; font-weight: 700; color: #64748b; white-space: nowrap;
    background: #f1f5f9; border-radius: 20px; padding: .1rem .45rem; }

/* Itens dentro do grupo */
.gedit-grupo-itens { display: flex; flex-direction: column; }
.gedit-item {
    display: flex; align-items: center; gap: .5rem; padding: .35rem .75rem;
    cursor: pointer; transition: background .1s; border-bottom: 1px solid #f8fafc;
}
.gedit-item:last-child { border-bottom: none; }
.gedit-item:hover { background: #f8fafc; }
.gedit-item-sel   { background: #f0fdf4; }
.gedit-item-sel:hover { background: #dcfce7; }
.gedit-item input[type="checkbox"] { flex-shrink: 0; cursor: pointer; }
.gedit-item-tipo {
    flex-shrink: 0; font-size: .6rem; font-weight: 800; padding: .12rem .3rem; border-radius: 4px;
}
.gedit-mat  { background: #dbeafe; color: #1d4ed8; }
.gedit-serv { background: #fef3c7; color: #92400e; }
.gedit-item-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: .4rem; }
.gedit-item-desc { font-size: .8rem; font-weight: 600; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.gedit-item-meta { font-size: .7rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }

/* ── Requisição de Material ──────────────────────────────────── */
.req-sem-requisicao { font-size:.7rem; color:#94a3b8; display:block; padding:.25rem 0; }
.req-row { display:flex; align-items:center; gap:.4rem; padding:.25rem 0; border-bottom:1px solid #f1f5f9; }
.req-row:last-child { border-bottom:none; }
.req-row-itens { font-size:.68rem; color:#64748b; margin-left:.15rem; }
.req-row-data  { font-size:.65rem; color:#94a3b8; margin-left:auto; }
.req-status-badge {
    display: inline-flex; align-items:center; gap:.25rem;
    font-size:.62rem; font-weight:700; padding:.1rem .4rem; border-radius:4px;
}
.req-status-rascunho  { background:#f1f5f9; color:#64748b; }
.req-status-enviada   { background:#dbeafe; color:#1d4ed8; }
.req-status-separado  { background:#e0e7ff; color:#4338ca; }
.req-status-despachado { background:#fef3c7; color:#92400e; }
.req-status-recebido  { background:#dcfce7; color:#166534; }
.req-status-parcial   { background:#fef3c7; color:#92400e; }
.req-status-correcao  { background:#fee2e2; color:#991b1b; }
.req-status-pill { display:inline-flex;align-items:center;gap:.3rem;padding:.18rem .55rem;border-radius:10px;font-size:.68rem;font-weight:600;white-space:nowrap; }

/* Chips de filtro rápido por status (Almoxarifado / Requisições) */
.req-chip {
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.3rem .65rem; border-radius:999px; cursor:pointer;
    border:1px solid; font-size:.74rem; font-weight:600;
    transition:all .15s;
}
.req-chip:hover { transform: translateY(-1px); }
.req-chip-count {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:1.4em; padding:0 .35em; border-radius:999px;
    background:rgba(0,0,0,.08); font-size:.7rem; font-weight:700;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
.req-limpar-filtros {
    background: none; border: 1px solid #e2e8f0; border-radius: 5px;
    cursor: pointer; font-size: .72rem; font-weight: 600; color: #dc2626;
    padding: .3rem .65rem; display: inline-flex; align-items: center; gap: .35rem;
    margin-left: .35rem;
}
.req-limpar-filtros:hover { background: #fef2f2; border-color: #fecaca; }
.req-limpar-filtros i { font-size: .65rem; }

.kit-acao-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem;
    border: 1px solid #dbe3f0;
    border-radius: 999px;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.kit-acao-toggle-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: .48rem .95rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.kit-acao-toggle-btn:hover {
    color: #334155;
    background: #eef2f7;
}

.kit-acao-toggle-btn.ativo {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    color: #c2410c;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08), inset 0 0 0 1px rgba(234, 88, 12, .18);
}
.req-audit-info  { font-size:.62rem; color:#94a3b8; display:flex; align-items:center; gap:.25rem; white-space:nowrap; }
.req-audit-info i { font-size:.55rem; }
.req-status-entregue  { background:#dcfce7; color:#166534; }
.req-btn-editar, .req-btn-cancelar, .req-btn-del {
    background:none; border:none; cursor:pointer; padding:.15rem .3rem;
    border-radius:4px; font-size:.7rem; line-height:1;
}
.req-btn-editar  { color:#3b82f6; }
.req-btn-editar:hover { background:#dbeafe; }
.req-btn-cancelar, .req-btn-del { color:#ef4444; }
.req-btn-cancelar:hover, .req-btn-del:hover { background:#fee2e2; }
.req-table { width:100%; border-collapse:collapse; font-size:.75rem; }
.req-table th { text-align:left; font-size:.68rem; font-weight:600; color:#64748b;
    padding:.35rem .5rem; border-bottom:2px solid #e2e8f0; }
.req-table td { padding:.35rem .5rem; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.req-qtd-input {
    width:80px; border:1px solid #cbd5e1; border-radius:5px; padding:.2rem .4rem;
    font-size:.75rem; font-family:inherit; text-align:right;
}
.req-qtd-input:focus { outline:none; border-color:#3b82f6; }
.btn-icon-sm {
    background:none; border:1px solid #e2e8f0; border-radius:5px; padding:.15rem .5rem;
    font-size:.75rem; color:#475569; cursor:pointer; display:inline-flex; align-items:center; gap:.3rem;
}
.btn-icon-sm:hover { background:#f1f5f9; border-color:#cbd5e1; }
.req-expand-row td { padding:0 !important; }
.cfg-tab-badge {
    display:inline-flex; align-items:center; justify-content:center;
    background:#ef4444; color:#fff; font-size:.6rem; font-weight:700;
    border-radius:9px; min-width:16px; height:16px; padding:0 4px; margin-left:4px;
}

/* ═══════════════════════════════════════════════════════════
   RELATÓRIOS
═══════════════════════════════════════════════════════════ */
.relat-page { padding: 0 2rem 1.5rem; max-width: 1400px; margin: 0 auto; }
.relat-header { margin-bottom: 1.2rem; }
.relat-titulo { font-size: 1.3rem; font-weight: 700; color: #1e2d4a; display:flex; align-items:center; gap:.5rem; }
.relat-titulo i { color: #e8722a; }

.relat-abas { display:flex; gap:.25rem; border-bottom:2px solid #e2e8f0; margin-bottom:1.2rem; }
.relat-aba {
    background:none; border:none; padding:.5rem 1rem; font-size:.85rem; font-weight:600;
    color:#64748b; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px;
    display:flex; align-items:center; gap:.35rem; transition:color .15s;
}
.relat-aba:hover { color:#1e2d4a; }
.relat-aba-ativa { color:#e8722a !important; border-bottom-color:#e8722a !important; }

.relat-secao { background:#fff; border-radius:10px; border:1px solid #e2e8f0; padding:1rem 1.2rem; }

.relat-filtros {
    display:flex; align-items:center; gap:.8rem; margin-bottom:.9rem;
    font-size:.82rem; color:#475569;
}
.relat-filtro-label { display:flex; align-items:center; gap:.35rem; cursor:pointer; font-weight:600; }
.relat-count { color:#94a3b8; margin-left:auto; }
.relat-count-pend { color:#d97706; font-weight:600; }
.relat-btn-refresh { background:none; border:none; color:#94a3b8; cursor:pointer; font-size:.9rem; padding:.2rem; }
.relat-btn-refresh:hover { color:#475569; }

.relat-carregando, .relat-vazio {
    text-align:center; color:#94a3b8; padding:2rem; font-size:.88rem;
}
.relat-vazio i { color:#22c55e; margin-right:.3rem; }

.relat-table-wrap { overflow-x:auto; }
.relat-table {
    width:100%; border-collapse:collapse; font-size:.8rem; color:#1e2d4a;
}
.relat-table thead th {
    padding:.5rem .7rem; text-align:left; font-size:.72rem; font-weight:700;
    color:#64748b; text-transform:uppercase; letter-spacing:.04em;
    border-bottom:2px solid #e2e8f0; white-space:nowrap;
}
.relat-th-num { text-align:center !important; }
.relat-table tbody td { padding:.45rem .7rem; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.relat-table tbody tr:last-child td { border-bottom:none; }
.relat-table tbody tr:hover td { background:#f8fafc; }

.relat-row-pend td { background:#fffbeb !important; }
.relat-row-pend:hover td { background:#fef3c7 !important; }
.relat-row-ok td { background:#f0fdf4 !important; }
.relat-row-ok:hover td { background:#dcfce7 !important; }

.relat-link-obra { color:#e8722a; font-weight:700; text-decoration:none; }
.relat-link-obra:hover { text-decoration:underline; }
.relat-tipo { color:#64748b; font-size:.75rem; }
.relat-td-num { text-align:center; }
.relat-zero { color:#94a3b8; }
.relat-badge-pend {
    background:#fef3c7; color:#b45309; border:1px solid #fde68a;
    border-radius:10px; padding:0 6px; font-size:.72rem; font-weight:700;
    display:inline-block;
}
.relat-badge-ok { color:#22c55e; font-weight:600; }
.relat-badge-sl {
    background:#dcfce7; color:#15803d; border:1px solid #86efac;
    border-radius:10px; padding:0 6px; font-size:.72rem; font-weight:700;
    display:inline-block;
}
.relat-badge-dl {
    background:#fee2e2; color:#dc2626; border:1px solid #fca5a5;
    border-radius:10px; padding:0 6px; font-size:.72rem; font-weight:700;
    display:inline-block;
}
.relat-badge-nd {
    background:#fef3c7; color:#b45309; border:1px solid #fde68a;
    border-radius:10px; padding:0 6px; font-size:.72rem; font-weight:700;
    display:inline-block;
}
.relat-th-sl { color:#15803d !important; }
.relat-th-dl { color:#dc2626 !important; }
.relat-levantadores { color:#475569; font-size:.75rem; max-width:180px; }
.relat-sem-lev { color:#cbd5e1; }

.relat-status-concluido {
    display:inline-flex; align-items:center; gap:.3rem;
    color:#16a34a; font-size:.75rem; font-weight:600;
}
.relat-status-pend {
    display:inline-flex; align-items:center; gap:.3rem;
    color:#d97706; font-size:.75rem;
}

.relat-btn-acao {
    background:none; border:1px solid #e2e8f0; border-radius:5px;
    padding:.2rem .45rem; cursor:pointer; color:#64748b; font-size:.75rem;
    transition:all .15s;
}
.relat-btn-acao:hover { background:#f1f5f9; color:#1e2d4a; }
.relat-btn-concluir { border-color:#bbf7d0; color:#16a34a; }
.relat-btn-concluir:hover { background:#f0fdf4; }
.relat-btn-reabrir { border-color:#fde68a; color:#b45309; }
.relat-btn-reabrir:hover { background:#fffbeb; }

/* ═══════════════════════════════════════════════════════════
   LEVANTAMENTO CARD (ObraDetalhe)
═══════════════════════════════════════════════════════════ */
.obra-lev-card {
    border-radius:10px; border:1px solid #e2e8f0;
    padding:.75rem 1.1rem; margin-bottom:1.2rem;
    background:#fff;
}
.obra-lev-pend    { border-color:#fde68a; background:#fffbeb; }
.obra-lev-ok      { border-color:#bbf7d0; background:#f0fdf4; }
.obra-lev-concluido { border-color:#bbf7d0; background:#f0fdf4; }

.obra-lev-header {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:.6rem; flex-wrap:wrap; gap:.4rem;
}
.obra-lev-title-wrap {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    min-width: 0;
}
.obra-lev-titulo { font-size:.82rem; font-weight:700; color:#1e2d4a; display:flex; align-items:center; gap:.35rem; }
.obra-lev-titulo i { color:#e8722a; }
.obra-lev-headline {
    font-size: 1rem;
    color: #13203a;
    line-height: 1.15;
}
.obra-lev-summary {
    font-size: .78rem;
    color: #64748b;
    max-width: 64ch;
}
.obra-lev-status {
    display:flex; align-items:center; gap:.3rem;
    font-size:.75rem; font-weight:600;
    padding: .38rem .7rem;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
}
.obra-lev-pend .obra-lev-status    { color:#d97706; }
.obra-lev-ok .obra-lev-status      { color:#16a34a; }
.obra-lev-concluido .obra-lev-status { color:#16a34a; }

.obra-lev-stats {
    display:flex; align-items:center; gap:1.5rem; flex-wrap:wrap;
}
.obra-lev-stat { display:flex; flex-direction:column; align-items:center; min-width:48px; }
.obra-lev-stat-val { font-size:1.1rem; font-weight:700; color:#1e2d4a; line-height:1.2; }
.obra-lev-stat-label { font-size:.65rem; color:#94a3b8; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.obra-lev-stat-warn .obra-lev-stat-val { color:#d97706; }
.obra-lev-action-slot { margin-left:auto; }

.obra-lev-btn {
    border-radius:6px; border:1px solid; padding:.3rem .8rem;
    font-size:.78rem; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:.35rem;
    transition:all .15s;
}
.obra-lev-btn:disabled { opacity:.6; cursor:not-allowed; }
.obra-lev-btn-concluir { border-color:#bbf7d0; background:#f0fdf4; color:#16a34a; }
.obra-lev-btn-concluir:hover:not(:disabled) { background:#dcfce7; }
.obra-lev-btn-reabrir { border-color:#fde68a; background:#fffbeb; color:#b45309; }
.obra-lev-btn-reabrir:hover:not(:disabled) { background:#fef3c7; }

/* ── Anotações PDF ── */
.plan-anot-pin {
    position: absolute;
    width: 20px; height: 20px;
    background: #f59e0b;
    color: #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 25;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    transition: background .15s, transform .15s;
    pointer-events: all;
    user-select: none;
}
.plan-anot-pin i { transform: rotate(45deg); font-size: .65rem; pointer-events: none; }
.plan-anot-pin:hover, .plan-anot-pin-sel { background: #d97706; transform: rotate(-45deg) scale(1.15); }
.plan-anot-pin-novo { background: #3b82f6 !important; }

.plan-anot-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    min-width: 200px; max-width: 280px;
    padding: .6rem .75rem;
    z-index: 30;
    font-size: .8rem;
    pointer-events: all;
}
.plan-anot-popup-audit {
    font-size: .72rem; color: #64748b;
    display: flex; align-items: center; gap: .3rem;
    margin-bottom: .4rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid #f1f5f9;
}
.plan-anot-popup-texto {
    color: #1e293b; line-height: 1.45;
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: .4rem;
}
.plan-anot-popup-footer {
    display: flex; gap: .35rem; justify-content: flex-end;
    margin-top: .35rem;
}

.plan-anot-novo-wrap { position: absolute; z-index: 26; pointer-events: all; }
.plan-anot-novo-bubble {
    position: absolute;
    left: 24px; top: -4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    padding: .55rem .7rem;
    min-width: 200px;
}

.plan-anot-textarea {
    width: 100%; min-width: 190px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: .35rem .45rem;
    font-size: .8rem;
    resize: vertical;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    color: #1e293b;
}
.plan-anot-textarea:focus { border-color: #3b82f6; }

.plan-anot-btn {
    background: #f1f5f9; border: 1px solid #e2e8f0;
    color: #475569; border-radius: 5px;
    padding: .25rem .5rem; font-size: .75rem;
    cursor: pointer; display: flex; align-items: center; gap: .25rem;
    transition: background .12s;
}
.plan-anot-btn:hover:not(:disabled) { background: #e2e8f0; }
.plan-anot-btn:disabled { opacity: .6; cursor: not-allowed; }
.plan-anot-btn-ok { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.plan-anot-btn-ok:hover:not(:disabled) { background: #bfdbfe; }
.plan-anot-btn-del { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.plan-anot-btn-del:hover:not(:disabled) { background: #fecaca; }

/* ── Edit Agendamento Modal ─────────────────────────────────────────────────── */
.edit-tabs {
    display: flex; border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0; background: #f8fafc; padding: 0 1rem;
}
.edit-tab {
    padding: .55rem 1rem; font-size: .8rem; font-weight: 600;
    color: #64748b; background: none; border: none; cursor: pointer;
    border-bottom: 2px solid transparent; transition: all .12s;
    display: flex; align-items: center; gap: .3rem;
}
.edit-tab:hover { color: #1e293b; }
.edit-tab-active { color: #e8722a; border-bottom-color: #e8722a; }
.edit-field-label {
    display: block; font-size: .7rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem;
}
.edit-btn-group { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid #d1d5db; }
.edit-toggle {
    padding: .3rem .7rem; font-size: .78rem; font-weight: 600;
    border: none; background: #fff; color: #64748b; cursor: pointer;
    transition: all .12s; border-right: 1px solid #d1d5db;
}
.edit-toggle:last-child { border-right: none; }
.edit-toggle:hover { background: #f1f5f9; }
.edit-toggle-on { background: #3b82f6; color: #fff; }
.edit-toggle-on:hover { background: #2563eb; }
.edit-toggle-danger { background: #ef4444 !important; color: #fff; }
.edit-toggle-danger:hover { background: #dc2626 !important; }
.edit-agend-section { margin-bottom: 1.2rem; }
.edit-agend-section-title {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    color: #94a3b8; letter-spacing: .06em; margin-bottom: .45rem;
    display: flex; align-items: center;
}
.edit-item-row {
    display: flex; align-items: center; gap: .45rem;
    padding: .3rem .45rem; border-radius: 6px;
    transition: background .12s;
}
.edit-item-row:hover { background: rgba(0,0,0,.04); }
.edit-item-removido { opacity: .5; text-decoration: line-through; background: rgba(220,38,38,.05) !important; }
.edit-item-tipo {
    width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; font-weight: 800; color: #fff;
}
.edit-tipo-n { background: #3b82f6; }
.edit-item-desc { flex: 1; font-size: .8rem; color: #374151; }
.edit-item-qtd  { font-size: .74rem; color: #6b7280; white-space: nowrap; }
.edit-item-lock { font-size: .78rem; opacity: .45; }
.edit-btn-del, .edit-btn-undo {
    border: none; background: transparent; cursor: pointer;
    padding: .18rem .32rem; border-radius: 4px; font-size: .74rem; line-height: 1;
}
.edit-btn-del  { color: #ef4444; }
.edit-btn-del:hover  { background: rgba(239,68,68,.1); }
.edit-btn-undo { color: #f59e0b; }
.edit-btn-undo:hover { background: rgba(245,158,11,.1); }
.badge-status-exec     { font-size: .63rem; background: #d1fae5; color: #065f46; padding: 2px 6px; border-radius: 10px; white-space:nowrap; }
.badge-status-prog     { font-size: .63rem; background: #fef3c7; color: #92400e; padding: 2px 6px; border-radius: 10px; white-space:nowrap; }
.badge-status-removido { font-size: .63rem; background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 10px; white-space:nowrap; }

.edit-req-row { border: 1px solid #e5e7eb; border-radius: 8px; padding: .5rem .7rem; margin-bottom: .45rem; }
.edit-req-header { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; flex-wrap: wrap; }
.edit-req-id { font-size: .75rem; font-weight: 600; color: #374151; }
.edit-req-status-badge { font-size: .63rem; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.edit-req-rascunho, .edit-req-pendente  { background: #fef3c7; color: #92400e; }
.edit-req-solicitado, .edit-req-enviada  { background: #dbeafe; color: #1e40af; }
.edit-req-separado, .edit-req-despachado { background: #e0e7ff; color: #3730a3; }
.edit-req-entregue, .edit-req-recebido  { background: #d1fae5; color: #065f46; }
.edit-req-cancelada { background: #f3f4f6; color: #6b7280; }
.edit-req-item { display: flex; gap: .5rem; padding-left: .15rem; font-size: .78rem; color: #6b7280; margin-top: .15rem; }
.edit-btn-cancel-req {
    margin-left: auto; border: 1px solid #fca5a5; background: transparent;
    color: #dc2626; padding: 2px 8px; border-radius: 5px; font-size: .7rem; cursor: pointer; white-space: nowrap;
}
.edit-btn-cancel-req:hover { background: #fee2e2; }

.edit-toggle-add {
    width: 100%; text-align: left; background: #f9fafb; border: 1px dashed #d1d5db;
    border-radius: 8px; padding: .5rem .75rem; font-size: .78rem; font-weight: 600;
    color: #4b5563; cursor: pointer; display: flex; align-items: center; gap: .4rem;
    transition: background .12s;
}
.edit-toggle-add:hover { background: #f1f5f9; }
.edit-add-group { margin-bottom: .4rem; }
.edit-add-group-hdr {
    font-size: .67rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .04em; margin: .4rem 0 .15rem .1rem;
}
.edit-add-item {
    display: flex; align-items: center; gap: .4rem;
    padding: .22rem .3rem; border-radius: 5px; cursor: pointer; font-size: .8rem; color: #374151;
    transition: background .1s;
}
.edit-add-item:hover { background: rgba(0,0,0,.04); }
.edit-add-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; }

/* ── Frota ─────────────────────────────────────────────────────────────────── */
.frota-stat {
    font-size: .72rem; padding: 2px 8px; border-radius: 10px;
    background: #f1f5f9; color: #475569; white-space: nowrap;
}
.frota-stat-green  { background: #d1fae5; color: #065f46; }
.frota-stat-blue   { background: #dbeafe; color: #1e40af; }
.frota-stat-purple { background: #e0e7ff; color: #3730a3; }
.frota-stat-teal   { background: #ccfbf1; color: #115e59; }
.frota-stat-amber  { background: #fef3c7; color: #92400e; }
.frota-stat-rose   { background: #ffe4e6; color: #9f1239; }
.frota-stat-gray   { background: #f3f4f6; color: #6b7280; }

.frota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .6rem;
}
.frota-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: .65rem .75rem; display: flex; flex-direction: column; gap: .35rem;
    transition: box-shadow .12s, border-color .12s;
    border-left: 3px solid #e5e7eb;
}
.frota-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.frota-card-constr  { border-left-color: #16a34a; }
.frota-card-stc     { border-left-color: #3b82f6; }
.frota-card-sup     { border-left-color: #7c3aed; }
.frota-card-comp    { border-left-color: #14b8a6; }
.frota-card-prancha { border-left-color: #f59e0b; }
.frota-card-reserva { border-left-color: #f43f5e; }
.frota-card-sem     { border-left-color: #d1d5db; }
.frota-card-off    { opacity: .5; background: #fafafa; }

.frota-card-hdr {
    display: flex; align-items: center; justify-content: space-between;
}
.frota-card-placa {
    font-size: .88rem; font-weight: 800; color: #1e293b;
    letter-spacing: .02em;
}
.frota-card-nome {
    font-size: .72rem; color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.frota-card-body { display: flex; flex-direction: column; gap: .25rem; }
.frota-card-equipe { display: flex; gap: .35rem; align-items: baseline; }
.frota-card-eq-nome { font-size: .75rem; font-weight: 600; color: #374151; }
.frota-card-eq-tipo { font-size: .65rem; color: #94a3b8; text-transform: uppercase; }
.frota-card-ftr {
    border-top: 1px solid #f1f5f9; padding-top: .3rem; margin-top: .1rem;
}

.frota-cat-badge {
    font-size: .65rem; font-weight: 600; padding: 2px 8px;
    border-radius: 10px; white-space: nowrap; width: fit-content;
}
.frota-cat-constr { background: #d1fae5; color: #065f46; }
.frota-cat-stc    { background: #dbeafe; color: #1e40af; }
.frota-cat-sup    { background: #e0e7ff; color: #3730a3; }
.frota-cat-select {
    font-size: .73rem; padding: 2px 4px; border-radius: 5px;
    width: 100%; height: 26px;
}

.frota-status {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; font-size: .6rem;
}
.frota-status-mov { background: #d1fae5; color: #16a34a; }
.frota-status-on  { background: #fef3c7; color: #d97706; }
.frota-status-off { background: #f3f4f6; color: #9ca3af; }
.frota-status-disabled { background: #fee2e2; color: #dc2626; }

.frota-toggle-label {
    display: flex; align-items: center; gap: .35rem;
    cursor: pointer; font-size: .7rem; color: #64748b;
}
.frota-toggle-label input[type=checkbox] {
    width: 28px; height: 16px; appearance: none; -webkit-appearance: none;
    background: #d1d5db; border-radius: 8px; position: relative;
    cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.frota-toggle-label input[type=checkbox]::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; transition: transform .15s;
}
.frota-toggle-label input[type=checkbox]:checked {
    background: #16a34a;
}
.frota-toggle-label input[type=checkbox]:checked::after {
    transform: translateX(12px);
}
.frota-toggle-text { user-select: none; }

.homolog-page .bases-header {
    align-items: flex-start;
    margin-bottom: 14px;
}

.homolog-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.homolog-stat {
    background: #fff;
    border: 1px solid #e7edf7;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: none;
}

.homolog-stat strong {
    display: block;
    font-size: 1.3rem;
    line-height: 1;
    color: #1f2a44;
}

.homolog-stat span {
    font-size: .72rem;
    color: #6b7a96;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.homolog-stat.aberto { border-color: #fecaca; }
.homolog-stat.analise { border-color: #fde68a; }
.homolog-stat.ajustado { border-color: #bfdbfe; }
.homolog-stat.validado { border-color: #86efac; }

.homolog-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    gap: 14px;
}

.homolog-form-panel,
.homolog-tracking-panel {
    padding: 18px;
}

.homolog-panel-head {
    margin-bottom: 12px;
}

.homolog-panel-head h3 {
    margin: 0;
    color: #1f2a44;
    font-size: 1.05rem;
    font-weight: 800;
}

.homolog-panel-head p {
    margin: 4px 0 0;
    color: #7b8aa7;
    line-height: 1.45;
    font-size: .88rem;
}

.homolog-mode-switch {
    display: inline-flex;
    border: 1px solid #d7e0ef;
    border-radius: 12px;
    padding: 3px;
    background: #fff;
    margin-bottom: 14px;
}

.homolog-mode-switch button,
.homolog-segmented button {
    border: 0;
    background: transparent;
    color: #6b7a96;
    font-weight: 700;
    border-radius: 9px;
    padding: .55rem .85rem;
    cursor: pointer;
    font-size: .92rem;
}

.homolog-mode-switch button.active,
.homolog-segmented button.active {
    background: #1f2a44;
    color: #fff;
    box-shadow: none;
}

.homolog-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.homolog-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #d7e0ef;
}

.homolog-checklist-block {
    border: 1px solid #e6edf7;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
}

.homolog-selection-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #d7e0ef;
    color: #42526e;
}

.homolog-selection-summary strong {
    color: #1f2a44;
    font-size: .9rem;
}

.homolog-selection-tag {
    display: inline-flex;
    align-items: center;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: #eef3fb;
    border: 1px solid #d7e0ef;
    color: #5f7190;
    font-size: .74rem;
    font-weight: 700;
}

.homolog-cenario-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.homolog-cenario-card {
    text-align: left;
    padding: 11px 12px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all .18s ease;
}

.homolog-cenario-card strong {
    display: block;
    font-size: .87rem;
    color: #1f2a44;
    margin-bottom: 3px;
}

.homolog-cenario-card span {
    display: block;
    font-size: .76rem;
    color: #6b7a96;
    line-height: 1.35;
}

.homolog-cenario-card:hover,
.homolog-cenario-card.active {
    border-color: #c9d6ea;
    box-shadow: none;
    transform: none;
    background: #f8fbff;
}

.homolog-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.homolog-upload-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.homolog-upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #e0e8f5;
}

.homolog-upload-item strong {
    display: block;
    color: #1f2a44;
}

.homolog-upload-item span {
    font-size: .82rem;
    color: #7b8aa7;
}

.homolog-success {
    background: #ecfdf3;
    border: 1px solid #86efac;
    color: #166534;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.homolog-tracking-head h3 {
    margin: 0;
    color: #1f2a44;
    font-size: 1.05rem;
    font-weight: 800;
}

.homolog-tracking-head p {
    margin: 4px 0 0;
    color: #7b8aa7;
    font-size: .88rem;
}

.homolog-ticket-counter {
    display: inline-flex;
    align-items: center;
    padding: .5rem .8rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dfe8f5;
    color: #5f7190;
    font-size: .78rem;
    font-weight: 700;
}

.homolog-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(160px, .6fr));
    gap: 10px;
    margin: 14px 0 16px;
}

.homolog-ticket-list {
    display: grid;
    gap: 14px;
}

.homolog-ticket-card {
    border: 1px solid #e6edf7;
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.homolog-ticket-top,
.homolog-ticket-foot,
.homolog-ticket-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.homolog-ticket-code {
    font-size: .72rem;
    font-weight: 800;
    color: #5f7190;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.homolog-ticket-card h4 {
    margin: 3px 0 0;
    font-size: .98rem;
    color: #1f2a44;
}

.homolog-ticket-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.homolog-pill {
    display: inline-flex;
    align-items: center;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
}

.homolog-pill.erro {
    color: #b91c1c;
    background: #fef2f2;
}

.homolog-pill.melhoria {
    color: #1d4ed8;
    background: #eff6ff;
}

.homolog-status-select {
    min-width: 150px;
    max-width: 170px;
}

.homolog-ticket-meta {
    margin-top: 10px;
    color: #6b7a96;
    font-size: .78rem;
}

.homolog-ticket-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.homolog-ticket-desc {
    margin: 12px 0;
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: .88rem;
}

.homolog-ticket-foot {
    color: #7b8aa7;
    font-size: .76rem;
}

.homolog-foto-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.homolog-foto-thumb {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    aspect-ratio: 1.2;
}

.homolog-foto-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 1200px) {
    .homolog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .homolog-stats,
    .homolog-form-grid,
    .homolog-cenario-grid,
    .homolog-filter-grid,
    .homolog-foto-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Book SIPEL ─────────────────────────────────────────────────────── */

.cfg-grupo-select {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: .85rem;
    width: 100%;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cfg-grupo-select:hover:not(:disabled) {
    border-color: #e8722a;
}

.cfg-grupo-select:focus {
    outline: none;
    border-color: #e8722a;
    box-shadow: 0 0 0 3px rgba(232, 114, 42, 0.15);
}

.cfg-grupo-select:disabled {
    opacity: .6;
    cursor: not-allowed;
    background: #f9fafb;
}

/* ============================================================
   Book SIPEL — BookConfigPanel
   ============================================================ */

.book-config-body {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-config-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.book-config-row > label {
    min-width: 130px;
    color: #6b7280;
    font-size: .85rem;
    font-weight: 600;
}

.book-config-row .form-input {
    max-width: 280px;
}

.book-zona-radios {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.book-radio,
.book-checkbox {
    display: flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    font-size: .9rem;
}

.book-flags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem 1rem;
    flex: 1;
    min-width: 280px;
}

.book-spinner {
    color: #9ca3af;
    font-size: .8rem;
    margin-left: .5rem;
}

.book-badge {
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
}

.book-badge-info {
    background: rgba(232, 114, 42, 0.1);
    border-color: #e8722a;
    color: #b45518;
}

@media (max-width: 600px) {
    .book-flags-grid { grid-template-columns: 1fr; }
}

.book-progress-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.book-progress-fill {
    height: 100%;
    transition: width .3s ease;
}

.book-grupo {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.book-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .65rem .9rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: .9rem;
    color: #374151;
}

.book-grupo-header:hover {
    background: #f3f4f6;
}

.book-grupo-body {
    padding: .25rem .9rem .65rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
}

.book-foto-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    padding: 2px 0;
}

.book-foto-ok { color: #16a34a; font-weight: 700; }
.book-foto-pendente { color: #9ca3af; font-weight: 700; }

/* Miniaturas de evidencias por ponto no painel de cobertura do book */
.evidencias-thumbs {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.evidencias-thumbs .thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}

.evidencias-thumbs .thumb:hover {
    transform: scale(1.05);
    border-color: #3ecf8e;
}

.evidencias-thumbs .more {
    font-size: 12px;
    color: #666;
    padding-left: 4px;
}

/* Lightbox para reclassificar evidencia */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox-content {
    background: white;
    padding: 16px;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    gap: 16px;
}

.lightbox-img {
    max-width: 60vw;
    max-height: 80vh;
    object-fit: contain;
    background: #111;
    border-radius: 4px;
}

.lightbox-meta {
    min-width: 240px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
}

/* Badge inline de evidencias de apontamento (sidebar do Planejar) */
.evid-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #c2410c;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    cursor: pointer;
    margin-left: 4px;
    line-height: 1.4;
}
.evid-badge i { font-size: 10px; }
.evid-badge:hover {
    background: #ffedd5;
    border-color: #fb923c;
}

/* Galeria (lightbox) de evidencias acionada pelo badge */
.evid-galeria-content {
    background: #fff;
    padding: 12px 16px 16px 16px;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 320px;
}
.evid-galeria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}
.evid-galeria-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
}
.evid-galeria-close:hover { background: #f3f4f6; color: #111827; }
.evid-galeria-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 70vh;
    overflow-y: auto;
}
.evid-galeria-thumb {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}
.evid-galeria-thumb:hover {
    transform: scale(1.03);
    border-color: #fb923c;
}
.evid-lightbox-foto { z-index: 20000; }

/* ████████████████████████████████████████████████████████████████████
   SISTEMA DE COMPONENTES CANÔNICOS — Opus (redesign 2026)
   Peças únicas consumidas por todas as telas. Sóbrio, denso, sem
   gradiente em controle. Migração progressiva: telas antigas mantêm
   suas classes legadas até serem portadas pra cá.
   ████████████████████████████████████████████████████████████████████ */

/* ── Botão ─────────────────────────────────────────────────────────── */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:var(--s-2);
    height:var(--control-h); padding:0 var(--s-4);
    font-family:inherit; font-size:var(--fs-md); font-weight:var(--fw-semibold);
    line-height:1; white-space:nowrap; cursor:pointer; user-select:none;
    border:1px solid transparent; border-radius:var(--r-sm);
    background:var(--gray-100); color:var(--text);
    transition:background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover        { background:var(--gray-200); }
.btn:focus-visible{ outline:none; box-shadow:var(--ring); }
.btn:disabled, .btn[disabled] { opacity:.5; cursor:not-allowed; }
.btn i, .btn svg  { font-size:.85em; }

.btn--primary { background:var(--primary); color:#fff; }
.btn--primary:hover { background:#d4631f; }
.btn--ghost   { background:transparent; border-color:var(--border-strong); color:var(--text-2); }
.btn--ghost:hover { background:var(--gray-100); color:var(--text); }
.btn--subtle  { background:var(--gray-100); color:var(--text-2); }
.btn--subtle:hover { background:var(--gray-200); color:var(--text); }
.btn--danger  { background:transparent; border-color:var(--danger-border); color:var(--danger); }
.btn--danger:hover { background:var(--danger-bg); }
.btn--danger-solid { background:var(--danger); color:#fff; }
.btn--danger-solid:hover { background:#b91c1c; }
.btn--success-solid { background:var(--success); color:#fff; }
.btn--success-solid:hover { background:#15803d; }
.btn--warning-solid { background:var(--warning); color:#fff; }
.btn--warning-solid:hover { background:#b45309; }
.btn--sm { height:28px; padding:0 var(--s-3); font-size:var(--fs-sm); }
.btn--lg { height:42px; padding:0 var(--s-5); font-size:var(--fs-base); }
.btn--block { width:100%; }

/* Botão só-ícone */
.btn-icon {
    display:inline-flex; align-items:center; justify-content:center;
    width:var(--control-h); height:var(--control-h); flex-shrink:0;
    border:1px solid transparent; border-radius:var(--r-sm);
    background:transparent; color:var(--text-2); cursor:pointer;
    font-size:var(--fs-base); transition:background .12s, color .12s, box-shadow .12s;
}
.btn-icon:hover { background:var(--gray-100); color:var(--text); }
.btn-icon:focus-visible { outline:none; box-shadow:var(--ring); }
.btn-icon--sm { width:28px; height:28px; font-size:var(--fs-md); }
.btn-icon--danger:hover { background:var(--danger-bg); color:var(--danger); }
.btn-icon--success:hover { background:var(--success-bg); color:var(--success); }
.btn-icon.is-active { background:color-mix(in srgb, var(--primary) 14%, transparent); color:var(--primary); }

/* ── Badge / Status pill ───────────────────────────────────────────── */
.badge {
    display:inline-flex; align-items:center; gap:var(--s-1);
    padding:2px var(--s-2); border-radius:var(--r-pill);
    font-size:var(--fs-xs); font-weight:var(--fw-semibold); line-height:1.4;
    white-space:nowrap; border:1px solid transparent;
    background:var(--neutral-bg); color:var(--neutral); border-color:var(--neutral-border);
}
.badge--success { background:var(--success-bg); color:var(--success); border-color:var(--success-border); }
.badge--danger  { background:var(--danger-bg);  color:var(--danger);  border-color:var(--danger-border); }
.badge--warning { background:var(--warning-bg); color:var(--warning); border-color:var(--warning-border); }
.badge--info    { background:var(--info-bg);    color:var(--info);    border-color:var(--info-border); }
.badge--neutral { background:var(--neutral-bg); color:var(--neutral); border-color:var(--neutral-border); }
.badge--solid.badge--success { background:var(--success); color:#fff; border-color:transparent; }
.badge--solid.badge--danger  { background:var(--danger);  color:#fff; border-color:transparent; }
.badge--solid.badge--warning { background:var(--warning); color:#fff; border-color:transparent; }
.badge--solid.badge--info    { background:var(--info);    color:#fff; border-color:transparent; }

/* Ponto de status (bolinha) */
.status-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; background:var(--neutral); }
.status-dot--success{ background:var(--success); }
.status-dot--danger { background:var(--danger); }
.status-dot--warning{ background:var(--warning); }
.status-dot--info   { background:var(--info); }

/* ── Chip de filtro ────────────────────────────────────────────────── */
.chip {
    display:inline-flex; align-items:center; gap:var(--s-2);
    height:30px; padding:0 var(--s-3); border-radius:var(--r-sm);
    font-size:var(--fs-sm); font-weight:var(--fw-medium); cursor:pointer;
    background:var(--surface); color:var(--text-2); border:1px solid var(--border);
    transition:background .12s, border-color .12s, color .12s;
}
.chip:hover { background:var(--gray-50); color:var(--text); }
.chip.is-active { background:var(--navy); color:#fff; border-color:var(--navy); }
.chip-count {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:1.5em; padding:0 5px; border-radius:var(--r-pill);
    background:color-mix(in srgb, currentColor 14%, transparent);
    font-size:var(--fs-xs); font-weight:var(--fw-bold);
}

/* ── Tabela de dados (densa) ───────────────────────────────────────── */
.data-table { width:100%; border-collapse:collapse; font-size:var(--fs-md); }
.data-table thead th {
    text-align:left; padding:var(--s-2) var(--s-3);
    font-size:var(--fs-xs); font-weight:var(--fw-semibold); letter-spacing:.04em;
    text-transform:uppercase; color:var(--text-muted);
    border-bottom:1px solid var(--border); background:var(--surface-2);
    white-space:nowrap; position:sticky; top:0; z-index:1;
}
.data-table tbody td {
    padding:var(--s-2) var(--s-3); border-bottom:1px solid var(--gray-100);
    color:var(--text); vertical-align:middle;
}
.data-table tbody tr:hover { background:var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom:none; }
.data-table .num { text-align:right; font-variant-numeric:tabular-nums; }
.data-table .col-acoes { text-align:right; white-space:nowrap; }
.data-table .cod { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:var(--fs-sm); color:var(--text-2); }

/* ── Card / superfície ─────────────────────────────────────────────── */
.card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-md); box-shadow:var(--shadow-1);
}
.card--flat { box-shadow:none; }
.card--clip { overflow:hidden; }   /* clipa cantos quando contém tabela */
.card-pad { padding:var(--s-5); }

/* ── KPI ───────────────────────────────────────────────────────────── */
.kpi-grid { display:grid; gap:var(--s-3);
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); margin-bottom:var(--s-4); }
.kpi {
    display:flex; flex-direction:column; gap:var(--s-1);
    padding:var(--s-4); background:var(--surface);
    border:1px solid var(--border); border-radius:var(--r-md);
}
.kpi-label { font-size:var(--fs-xs); font-weight:var(--fw-semibold); letter-spacing:.04em;
    text-transform:uppercase; color:var(--text-muted); }
.kpi-value { font-size:var(--fs-2xl); font-weight:var(--fw-bold); color:var(--text); line-height:1.1;
    font-variant-numeric:tabular-nums; }
.kpi-sub   { font-size:var(--fs-sm); color:var(--text-2); }
.kpi-delta--up   { color:var(--success); }
.kpi-delta--down { color:var(--danger); }

/* ── Barra de progresso ────────────────────────────────────────────── */
.progress { height:6px; border-radius:var(--r-pill); background:var(--gray-100); overflow:hidden; }
.progress-fill { height:100%; background:var(--navy); border-radius:inherit; transition:width .2s; }
.progress-fill--success { background:var(--success); }
.progress-fill--warning { background:var(--warning); }
.progress-fill--danger  { background:var(--danger); }
.progress-fill--primary { background:var(--primary); }

/* ── Alerta / banner ───────────────────────────────────────────────── */
.alert {
    display:flex; align-items:flex-start; gap:var(--s-2);
    padding:var(--s-3) var(--s-4); border-radius:var(--r-sm);
    font-size:var(--fs-md); border:1px solid var(--border);
    background:var(--surface-2); color:var(--text);
    border-left-width:3px;
}
.alert i { margin-top:2px; flex-shrink:0; }
.alert--info    { background:var(--info-bg);    border-color:var(--info-border);    border-left-color:var(--info); }
.alert--info i  { color:var(--info); }
.alert--success { background:var(--success-bg); border-color:var(--success-border); border-left-color:var(--success); }
.alert--success i { color:var(--success); }
.alert--warning { background:var(--warning-bg); border-color:var(--warning-border); border-left-color:var(--warning); }
.alert--warning i { color:var(--warning); }
.alert--danger  { background:var(--danger-bg);  border-color:var(--danger-border);  border-left-color:var(--danger); }
.alert--danger i { color:var(--danger); }

/* ── Estado vazio ──────────────────────────────────────────────────── */
.empty-state {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:var(--s-3); padding:var(--s-10) var(--s-5); text-align:center;
    color:var(--text-muted);
}
.empty-state i { font-size:32px; color:var(--gray-300); }
.empty-state-title { font-size:var(--fs-base); font-weight:var(--fw-semibold); color:var(--text-2); }
.empty-state-sub   { font-size:var(--fs-md); color:var(--text-muted); max-width:42ch; }

/* ── Campo de formulário ───────────────────────────────────────────── */
.field { display:flex; flex-direction:column; gap:var(--s-1); }
.field-label { font-size:var(--fs-sm); font-weight:var(--fw-medium); color:var(--text-2); }
.input {
    height:var(--control-h); padding:0 var(--s-3); width:100%;
    font-family:inherit; font-size:var(--fs-base); color:var(--text);
    background:var(--surface); border:1px solid var(--border-strong);
    border-radius:var(--r-sm); transition:border-color .12s, box-shadow .12s;
}
.input:focus { outline:none; border-color:var(--primary); box-shadow:var(--ring); }
.input:disabled { background:var(--gray-100); color:var(--text-muted); cursor:not-allowed; }
textarea.input { height:auto; padding:var(--s-2) var(--s-3); resize:vertical; }
select.input { cursor:pointer; }
.check-row { display:flex; align-items:center; gap:var(--s-2); cursor:pointer;
    font-size:var(--fs-base); color:var(--text-2); }
.check-row input[type=checkbox] { width:16px; height:16px; accent-color:var(--primary); cursor:pointer; }

/* ── Cabeçalho de página + toolbar ─────────────────────────────────── */
.page-header { display:flex; align-items:flex-start; justify-content:space-between;
    gap:var(--s-4); margin-bottom:var(--s-5); }
.page-title { font-size:var(--fs-xl); font-weight:var(--fw-bold); color:var(--text); line-height:1.2; }
.page-subtitle { font-size:var(--fs-md); color:var(--text-muted); margin-top:2px; }
.toolbar { display:flex; align-items:center; gap:var(--s-2); flex-wrap:wrap; }
.toolbar-spacer { margin-left:auto; }
/* Largura contida de input em toolbar (input é width:100% por padrão) */
.input--inline { width:auto; min-width:160px; }
.input--sm { width:auto; min-width:120px; }
/* Título de subseção dentro de uma página/relatório */
.section-title, .relat-secao-titulo {
    font-size:var(--fs-base); font-weight:var(--fw-semibold); color:var(--text);
    margin:var(--s-5) 0 var(--s-3); display:flex; align-items:center; gap:var(--s-2);
}
.section-title:first-child, .relat-secao-titulo:first-child { margin-top:0; }
/* Grade de 2 colunas (ex: matriz de permissões) */
.perm-matriz { display:grid; grid-template-columns:1fr 1fr; gap:var(--s-1) var(--s-4); }
@media (max-width:640px){ .perm-matriz { grid-template-columns:1fr; } }

/* ── Grade de cards de atalho (hub) ────────────────────────────────── */
.cards-grid { display:grid; gap:var(--s-3);
    grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); }
.hub-card {
    display:flex; flex-direction:column; gap:var(--s-2); padding:var(--s-4);
    background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
    text-decoration:none; color:inherit; cursor:pointer;
    transition:border-color .12s, box-shadow .12s, transform .12s;
}
.hub-card:hover { border-color:var(--border-strong); box-shadow:var(--shadow-1); }
.hub-card-icon {
    width:36px; height:36px; display:flex; align-items:center; justify-content:center;
    border-radius:var(--r-sm); background:color-mix(in srgb, var(--primary) 12%, transparent);
    color:var(--primary); font-size:var(--fs-lg);
}
.hub-card-title { font-size:var(--fs-base); font-weight:var(--fw-semibold); color:var(--text); }
.hub-card-sub { font-size:var(--fs-sm); color:var(--text-muted); }

/* ── Perfil (cards de identidade/permissões/sessões) ───────────────── */
.profile-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--s-5); }
@media (max-width:900px){ .profile-grid { grid-template-columns:1fr; } }
.profile-id { display:flex; align-items:center; gap:var(--s-4); margin-bottom:var(--s-4); }
.profile-avatar { width:56px; height:56px; border-radius:50%; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background:var(--navy); color:#fff; font-size:var(--fs-lg); font-weight:var(--fw-bold); }
.profile-name { font-size:var(--fs-lg); font-weight:var(--fw-bold); color:var(--text); }
.profile-roles { display:flex; gap:var(--s-2); margin-top:var(--s-1); flex-wrap:wrap; }
.profile-dl { display:grid; grid-template-columns:auto 1fr; gap:var(--s-2) var(--s-4); font-size:var(--fs-md); }
.profile-dl dt { color:var(--text-muted); font-weight:var(--fw-semibold); }
.profile-dl dd { color:var(--text); }
.perm-item { display:flex; align-items:center; gap:var(--s-2); font-size:var(--fs-md); color:var(--text-2); padding:var(--s-1) 0; }
.perm-item i { color:var(--success); }
.perm-item--off { opacity:.4; }
.perm-item--off i { color:var(--danger); }
.profile-sessoes-scroll { max-height:200px; overflow-y:auto; }

/* ── Abas ──────────────────────────────────────────────────────────── */
.tab-bar { display:flex; gap:var(--s-1); border-bottom:1px solid var(--border); }
.tab {
    display:inline-flex; align-items:center; gap:var(--s-2);
    padding:var(--s-3) var(--s-4); background:none; border:none; cursor:pointer;
    font-family:inherit; font-size:var(--fs-md); font-weight:var(--fw-medium);
    color:var(--text-muted); border-bottom:2px solid transparent; margin-bottom:-1px;
    transition:color .12s, border-color .12s;
}
.tab:hover { color:var(--text-2); }
.tab.is-active { color:var(--primary); border-bottom-color:var(--primary); font-weight:var(--fw-semibold); }

/* ── Segmented control (escolha exclusiva compacta) ────────────────── */
.segmented { display:inline-flex; background:var(--gray-100); border-radius:var(--r-sm); padding:2px; }
.segmented button {
    background:none; border:none; cursor:pointer; font-family:inherit;
    font-size:var(--fs-sm); font-weight:var(--fw-semibold); color:var(--text-muted);
    padding:var(--s-1) var(--s-3); border-radius:calc(var(--r-sm) - 2px);
    display:inline-flex; align-items:center; gap:var(--s-1); transition:background .12s, color .12s;
}
.segmented button.is-active { background:var(--surface); color:var(--text); box-shadow:var(--shadow-1); }

/* ── Drawer (painel lateral deslizante) ────────────────────────────── */
.c-drawer-overlay { position:fixed; inset:0; background:rgba(15,23,42,.32);
    z-index:1200; animation:cFade .12s ease; }
.c-drawer {
    position:fixed; top:0; right:0; bottom:0; width:min(440px,92vw);
    background:var(--surface); box-shadow:var(--shadow-2); z-index:1201;
    display:flex; flex-direction:column; animation:cSlideIn .16s ease;
}
.c-drawer-header { display:flex; align-items:center; justify-content:space-between;
    gap:var(--s-3); padding:var(--s-4) var(--s-5); border-bottom:1px solid var(--border); }
.c-drawer-title { font-size:var(--fs-lg); font-weight:var(--fw-semibold); color:var(--text); }
.c-drawer-body { flex:1; overflow-y:auto; padding:var(--s-5); display:flex; flex-direction:column; gap:var(--s-4); }
.c-drawer-footer { display:flex; gap:var(--s-2); padding:var(--s-4) var(--s-5);
    border-top:1px solid var(--border); }
@keyframes cSlideIn { from{transform:translateX(16px);opacity:.4} to{transform:none;opacity:1} }

/* ── Modal (diálogo centralizado) ──────────────────────────────────── */
.c-modal-overlay { position:fixed; inset:0; background:rgba(15,23,42,.42);
    display:flex; align-items:center; justify-content:center; padding:var(--s-5);
    z-index:1300; animation:cFade .12s ease; }
.c-modal {
    background:var(--surface); border-radius:var(--r-md); box-shadow:var(--shadow-2);
    width:min(560px,100%); max-height:86vh; display:flex; flex-direction:column;
    animation:cPop .14s ease;
}
.c-modal--lg { width:min(760px,100%); }
.c-modal--md { width:min(640px,100%); }
.c-modal--sm { width:min(420px,100%); }
.c-modal-header { display:flex; align-items:center; justify-content:space-between;
    gap:var(--s-3); padding:var(--s-4) var(--s-5); border-bottom:1px solid var(--border); }
.c-modal-title { font-size:var(--fs-lg); font-weight:var(--fw-semibold); color:var(--text);
    display:flex; align-items:center; gap:var(--s-2); }
.c-modal-body { flex:1; overflow-y:auto; padding:var(--s-5); }
.c-modal-footer { display:flex; justify-content:flex-end; gap:var(--s-2);
    padding:var(--s-4) var(--s-5); border-top:1px solid var(--border); }
@keyframes cFade { from{opacity:0} to{opacity:1} }
@keyframes cPop  { from{transform:scale(.97);opacity:.5} to{transform:none;opacity:1} }

/* ── Turno: serviços executados agrupados por kit ──────────────────── */
.jorn-kit-grupo { border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:var(--s-2); overflow:hidden; }
.jorn-kit-hdr {
    display:flex; align-items:center; gap:var(--s-2);
    padding:var(--s-2) var(--s-3); background:var(--surface-2); border-bottom:1px solid var(--border);
    font-size:var(--fs-sm);
}
.jorn-kit-cod { font-family:ui-monospace,monospace; font-weight:var(--fw-bold); color:var(--primary); }
.jorn-kit-desc { font-weight:var(--fw-semibold); color:var(--text); flex:1; min-width:0;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.jorn-kit-cnt { color:var(--text-muted); font-size:var(--fs-xs); white-space:nowrap; }
.jorn-kit-val { color:var(--success); font-weight:var(--fw-bold); white-space:nowrap;
    background:var(--success-bg); padding:1px var(--s-2); border-radius:var(--r-pill); }
.jorn-kit-svc { display:flex; align-items:center; gap:var(--s-2);
    padding:var(--s-2) var(--s-3); border-top:1px solid var(--gray-100); font-size:var(--fs-sm); }
.jorn-kit-svc:first-of-type { border-top:none; }
.jorn-kit-svc .jorn-svc-desc { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text-2); }
.jorn-kit-svc-qty { font-weight:var(--fw-semibold); color:var(--text); white-space:nowrap; font-variant-numeric:tabular-nums; }
.jorn-kit-svc-vaos {
    font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:var(--info);
    background:var(--info-bg); padding:0 6px; border-radius:var(--r-pill); margin-left:var(--s-2);
    white-space:nowrap;
}
