/* ============================
   Time Bank CSS
   Aligned to Design System (838px — via base.css .tool-wrap.large)
============================ */

/* Upgrade CTA */
.cta-upgrade {
    text-align: center;
    margin-top: var(--space-md);
}

.cta-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: var(--space-sm);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 var(--space-md);
    color: var(--text);
}

/* 4. Workday (Inline) */
.jornada-inline {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: fit-content;
    min-width: 150px;
    margin-left: 10px;
}

.jornada-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.jornada-inputs input {
    width: 60px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 6px;
    border-radius: 6px;
}

/* 5. Time Grid */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: var(--space-md);
    align-items: end;
}

.horario-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.horario-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

/* 6. Actions */
.action-field {
    display: flex;
    align-items: flex-end;
}

.action-field button {
    white-space: nowrap;
}

/* 7. Summaries */
.bh-summary-grid {
    width: 100%;
}

.summary-card {
    margin-top: 0;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item.highlight {
    padding: var(--space-sm);
    background: color-mix(in srgb, var(--primary) 5%, var(--card));
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
    border-radius: 8px;
    margin-top: var(--space-xs);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

/* 8. Responsiveness */
@media (width <= 900px) {
    .page-content .container.tool-wrap.large {
        padding: 0 var(--space-md);
    }

    .horarios-grid {
        grid-template-columns: 1fr 1fr;
    }

    .action-field {
        grid-column: span 2;
        width: 100%;
    }

    .jornada-inline {
        margin-left: 0;
        margin-top: var(--space-sm);
    }
}

@media (width <= 600px) {
    .horarios-grid {
        grid-template-columns: 1fr;
    }

    .action-field {
        grid-column: span 1;
    }
}

/* ============================
   Monthly History
============================ */

.bh-table-section {
    width: 100%;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.table-header .card-title {
    margin: 0;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.month-nav button {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.month-nav button:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--bg));
    border-color: var(--primary);
}

.month-nav strong {
    font-size: 0.9rem;
    min-width: 140px;
    text-align: center;
}

/* Table */
.bh-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.bh-table thead th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
}

.bh-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.bh-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 3%, var(--card));
}

/* Dark mode hover */
html.dark .bh-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

/* ============================
   Annual Summary
============================ */

.card-header-with-nav {
    margin-bottom: var(--space-md);
}

.annual-card .stat-item.highlight {
    margin-top: var(--space-md);
}

/* ============================
   Layout + compact spacing
============================ */

.page-content .container.tool-wrap.large {
    display: flex;
    flex-direction: column;
}

/* Compact spacing scoped to this tool */
.page-content .container.tool-wrap.large .card {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.page-content .container.tool-wrap.large .tool-header {
    margin-bottom: var(--space-md);
}

.bh-summary-grid {
    margin-bottom: 0;
}

/* ============================
   FIX: Clock icon in dark mode
============================ */

/* Forces color-scheme for time inputs to follow the active theme */
.horario-field input[type="time"] {
    width: 110px;
    color-scheme: light;
}

html.dark .horario-field input[type="time"] {
    color-scheme: dark;

    /* Ensures contrast for the native clock icon */
    background: var(--input-bg);
    color: var(--text);
}

.bh-input-section,
.bh-summary-grid,
.bh-table-section,
.annual-card,
.input-card {
    max-width: 100%;
}

