/* =======================
   RESET BÁSICO
======================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: #0f172a; /* azul oscuro tipo mockup */
    color: #e5e7eb;
}

/* =======================
   LAYOUT GENERAL
======================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

header.topbar {
    background: #020617;
    border-bottom: 1px solid #1e293b;
}

header.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.topbar h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
}

.subtitle {
    font-size: 12px;
    color: #94a3b8;
}

/* =======================
   CARDS
======================= */
.card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 16px;
}

.card h2,
.card h3,
.card h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
    color: #f8fafc;
}

/* =======================
   TABLAS
======================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    padding: 10px 8px;
    border-bottom: 1px solid #1e293b;
}

tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(148, 163, 184, 0.05);
}

small {
    font-size: 11px;
    color: #94a3b8;
}

/* =======================
   BADGES (ESTADOS)
======================= */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Market / Sector states */
.badge.bull {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge.bear {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.mixed {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge.leader {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge.neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5f5;
}

.badge.laggard {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Stock signals */
.badge.look {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge.watch {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.badge.ignore {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* =======================
   BOTONES
======================= */
button {
    background: #020617;
    border: 1px solid #1e293b;
    color: #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

button:hover {
    background: #020617;
    border-color: #334155;
}

/* =======================
   PLACEHOLDER GRÁFICA
======================= */
.chart-placeholder {
    height: 220px;
    border-radius: 6px;
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.15),
        rgba(59, 130, 246, 0.15)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5f5;
    font-size: 13px;
}

/* =======================
   UTILIDADES
======================= */
.text-muted {
    color: #94a3b8;
    font-size: 13px;
}

.grid {
    display: grid;
    gap: 24px;
}
/* ===== PAGE ===== */
.page-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== FILTERS ===== */
.filters-card {
    background: #0f172a;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 4px;
}

.filter-group input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 6px;
    color: #e5e7eb;
}

.filter-action {
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

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

.filters-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

/* ===== TABLE ===== */
.table-wrapper {
    overflow-x: auto;
}

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

.stocks-table thead th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 0.75rem;
}

.stocks-table tbody tr {
    border-top: 1px solid #1e293b;
}

.stocks-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.stocks-table td {
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* ===== CELLS ===== */
.ticker {
    font-weight: 600;
}

.company {
    color: #e5e7eb;
}

.rs {
    font-weight: 600;
}

.action a {
    color: #60a5fa;
    text-decoration: none;
}

.action a:hover {
    text-decoration: underline;
}

/* ===== STATES ===== */
.state {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.state.leader {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.state.neutral {
    background: rgba(148,163,184,0.15);
    color: #94a3b8;
}

.state.laggard {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

/* ===== EMPTY ===== */
.empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}


table thead th {
    position: sticky;
    top: 0;
    background: #020617;
    z-index: 2;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 1.5rem 0;
    font-size: 0.75rem;
}

.table-pagination .page {
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.15s ease;
}

.table-pagination .page:hover {
    background: rgba(148,163,184,0.12);
    color: #e5e7eb;
}

.table-pagination .page.active {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}

.table-pagination .page.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.table-pagination .dots {
    opacity: 0.4;
    padding: 0 0.25rem;
}
.table-pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin: 1.5rem 0 2rem;
}

.pagination-summary {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.pagination-summary strong {
    color: #e5e7eb;
    font-weight: 600;
}

.topbar {
    background: #0f172a;
    color: #fff;
    padding: 12px 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
}

.subtitle {
    font-size: 12px;
    opacity: 0.7;
}

.main-nav a {
    color: #cbd5f5;
    margin-left: 20px;
    text-decoration: none;
    font-weight: 500;
}

.main-nav a.active {
    color: #ffffff;
    border-bottom: 2px solid #38bdf8;
    padding-bottom: 2px;
}