/* =========================================
   JournalByTTS — components/tables.css
   table, .table-*, thead, tbody, th, td
   ========================================= */

/* ─── TABLAS ─── */
.table-container { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table thead { background: var(--bg-sunk); }

.table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-sunk);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
    color: var(--ink-2);
}
.table td:first-child { color: var(--ink); font-weight: 500; }
.table td.num {
    font-family: var(--font-mono);
    font-feature-settings: "tnum" 1;
    text-align: right;
}
.table td.num.pos, .table td.positive { color: var(--pos); }
.table td.num.neg, .table td.negative { color: var(--neg); }

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); cursor: pointer; }
.table.mb-0 { margin-bottom: 0; }

/* Tabla hover mejorado */
.table tbody tr {
    transition: background 0.12s;
}
.table tbody tr:hover {
    background: rgba(206,191,159,0.15);
}

/* Tabla moderna */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th {
    background: var(--bg-sunk);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    color: var(--ink-3);
    font-weight: 600;
}
.table tbody td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--divider); font-size: var(--text-sm); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(206,191,159,0.13); }

/* num utility */
.num { font-family: var(--font-mono); font-feature-settings: "tnum" 1; text-align: right; }
.num.pos { color: var(--pos); }
.num.neg { color: var(--neg); }

/* ─── FIRMA SUMMARY TABLE ─── */
.firm-summary-table th,
.firm-summary-table td {
    font-size: 0.82rem;
    padding: 10px 14px;
    vertical-align: middle;
}
.firm-summary-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    background: var(--washi);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.firm-summary-table td { border-bottom: 1px solid var(--border); }
.firm-summary-table tbody tr:last-child td { border-bottom: none; }
.firm-summary-table tbody tr:hover { background: var(--washi); }
.firm-summary-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.85rem;
}

/* ─── FIRMA SUMMARY CARDS ─── */
#firmSummaryContainer {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
#firmSummaryContainer::-webkit-scrollbar { display: none; }
.firm-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    flex: 1 1 180px;
    min-width: 160px;
}
.firm-summary-card .firm-summary-name {
    font-size: 0.9rem;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.firm-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.firm-summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.firm-summary-label {
    font-size: 0.75rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.firm-summary-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
}

/* ─── components.css table ─── */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunk);
}
.table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--divider);
  font-size: var(--text-sm);
}
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }

/* ─── LIGHT THEME ─── */
html[data-theme="light"] .table th {
    background: rgba(0,0,0,0.02);
    color: var(--ink-3);
    border-color: var(--border);
}
html[data-theme="light"] .table td {
    color: var(--ink-3);
    border-color: rgba(30,60,100,0.06);
}
html[data-theme="light"] .table tbody tr:hover { background: rgba(0,0,0,0.02); }
