/* ═══════════════════════════════════════════════════════
   TEMPLATE INDICADORES COMPLETOS
   ═══════════════════════════════════════════════════════ */

/* Cores por categoria */
:root {
    --cc-cambio: #00e5ff;
    --cc-bolsa: #39ff14;
    --cc-impostos: #ff6b35;
    --cc-crime: #ff3b3b;
    --cc-energia: #ffb300;
    --cc-saude: #4af4c8;
    --cc-emprego: #7b9fff;
    --cc-edu: #b78af7;
}

/* Container principal */
.ind-wrap {
    display: flex;
    gap: 0;
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 5rem;
    position: relative;
    z-index: 1;
}

/* Sidebar lateral */
.ind-side {
    width: 206px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--ticker-h, 32px) + var(--header-h, 60px) + 1rem);
    height: fit-content;
    border: 1px solid var(--border-dim);
    background: var(--bg-panel);
    padding: 1.25rem 0;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.ind-side-title {
    font-family: var(--font-mono);
    font-size: 0.57rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
    padding: 0 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
    margin-bottom: 0.5rem;
}

.ind-side-title::before {
    content: '// ';
    opacity: 0.4;
}

.ind-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ind-nav li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.63rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    text-transform: uppercase;
}

.ind-nav li a .nd {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.ind-nav li a:hover,
.ind-nav li a.active {
    color: var(--text-primary);
    background: rgba(0, 229, 255, 0.04);
}

.ind-nav li a.active {
    border-left-color: var(--cc, #00e5ff);
}

.ind-nav li a.active .nd {
    opacity: 1;
    box-shadow: 0 0 6px currentColor;
}

/* Corpo principal */
.ind-body {
    flex: 1;
    min-width: 0;
    padding-left: 2.5rem;
}

/* Seção de indicador */
.ind-sec {
    margin-bottom: 5rem;
    scroll-margin-top: calc(var(--ticker-h, 32px) + var(--header-h, 60px) + 24px);
}

/* Cabeçalho da seção */
.isec-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-dim);
    flex-wrap: wrap;
}

.isec-icon {
    font-size: 1.35rem;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    flex-shrink: 0;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.isec-info {
    flex: 1;
}

.isec-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.isec-sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

.isec-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.isec-pill {
    font-family: var(--font-mono);
    font-size: 0.57rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid;
    padding: 0.18rem 0.6rem;
}

.isec-fonte {
    font-family: var(--font-mono);
    font-size: 0.57rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* Grid de cards */
.icards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

/* Card individual */
.ic {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    padding: 0.9rem 0.9rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    overflow: hidden;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.ic::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--cc, #00e5ff);
    transition: width 0.4s;
}

.ic:hover {
    background: var(--bg-card-hover);
    border-color: color-mix(in srgb, var(--cc, #00e5ff) 35%, transparent);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.ic:hover::after {
    width: 100%;
}

.ic-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
}

.ic-label {
    font-family: var(--font-mono);
    font-size: 0.57rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ic-badge {
    font-family: var(--font-mono);
    font-size: 0.49rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cc, #00e5ff);
    border: 1px solid currentColor;
    padding: 0.07rem 0.32rem;
    opacity: 0.75;
}

.ic-valor {
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: 0.02em;
    transition: opacity 0.35s ease;
}

.ic-var {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    letter-spacing: 0.05em;
    transition: opacity 0.35s ease;
}

.ic-var.up { color: #39ff14; }
.ic-var.down { color: #ff3b3b; }
.ic-var.flat { color: var(--text-dim); }

/* Sparkline */
.sparkline {
    width: 100%;
    height: 34px;
    margin-top: 0.28rem;
    display: block;
    overflow: visible;
}

/* Detalhes do card */
.ic-det {
    font-family: var(--font-mono);
    font-size: 0.53rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    padding-top: 0.28rem;
    border-top: 1px solid rgba(0, 229, 255, 0.06);
}

/* Subtítulo de subseção */
.isub-label {
    font-family: var(--font-mono);
    font-size: 0.59rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0.6;
    margin: 1.5rem 0 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.isub-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-dim);
}

/* Tabela */
.itable-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-dim);
    background: var(--bg-card);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.2) transparent;
}

.itable {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 0.83rem;
}

.itable thead th {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tc, #00e5ff);
    opacity: 0.75;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 229, 255, 0.12);
    white-space: nowrap;
    background: var(--bg-panel);
}

.itable tbody tr {
    border-bottom: 1px solid var(--border-dim);
    transition: background 0.18s;
}

.itable tbody tr:last-child {
    border-bottom: none;
}

.itable tbody tr:hover {
    background: var(--bg-card-hover);
}

.itable tbody td {
    padding: 0.65rem 1rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.itable tbody td.td-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Formatação de valores */
.tu { color: #39ff14; font-family: var(--font-mono); font-size: 0.78rem; }
.td { color: #ff3b3b; font-family: var(--font-mono); font-size: 0.78rem; }
.tf { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.78rem; }
.tm { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; }

/* Status */
.st-bom { color: #39ff14; }
.st-reg { color: #ffb300; }
.st-ruim { color: #ff3b3b; }

/* Barra de status ao vivo */
.live-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--border-dim);
    background: var(--bg-panel);
    margin-bottom: 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}

.live-bar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #39ff14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
    animation: ldot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes ldot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-status {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-ts { color: var(--text-dim); }
.live-ts span { color: var(--accent-cyan, #00e5ff); }

.pregao-badge {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid;
    padding: 0.15rem 0.55rem;
}

.live-refresh {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}

.live-refresh:hover {
    border-color: rgba(0, 229, 255, 0.4);
    color: var(--accent-cyan, #00e5ff);
    background: rgba(0, 229, 255, 0.06);
}

/* Pills de navegação mobile */
.ind-pills {
    display: none;
    overflow-x: auto;
    gap: 0.45rem;
    padding: 0.7rem 1.5rem;
    margin: 0 -1.5rem 0.75rem;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-dim);
    position: sticky;
    top: calc(var(--ticker-h, 32px) + var(--header-h, 60px));
    background: var(--bg-void);
    z-index: 99;
    flex-wrap: nowrap;
}

.ind-pills::-webkit-scrollbar {
    display: none;
}

.ind-pill {
    font-family: var(--font-mono);
    font-size: 0.59rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--border-dim);
    padding: 0.32rem 0.8rem;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
}

.ind-pill.active,
.ind-pill:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.06);
}

/* Responsivo */
@media (max-width: 900px) {
    .ind-side { display: none; }
    .ind-body { padding-left: 0; }
    .ind-pills { display: flex; }
    .icards { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}

@media (max-width: 520px) {
    .icards { grid-template-columns: 1fr 1fr; }
    .isec-meta { display: none; }
}