/* ═══════════════════════════════════════════════════════════════════
 * quantas-semanas-tem.css
 * Overrides específicos da ferramenta. Reaproveita /css/calendario.css
 * para o calendário mensal e /css/style-hub.css para variáveis globais.
 * ═══════════════════════════════════════════════════════════════════ */

/* ───── Breadcrumb visível ──────────────────────────────────────── */
.qst-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted, var(--secondary-color));
    margin: 12px 0 20px;
}
.qst-breadcrumb a { color: var(--primary-color); text-decoration: none; }
.qst-breadcrumb a:hover { text-decoration: underline; }

/* ───── Navegação por ano ───────────────────────────────────────── */
.qst-year-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
    font-size: 1rem;
}
.qst-year-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.qst-year-nav a:hover {
    background: var(--light-bg, #f5f5f7);
    border-color: var(--border-color);
}
.qst-year-nav .qst-year-current {
    font-weight: 800;
    font-size: 1.2rem;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.qst-year-nav form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.qst-year-nav input[type="number"] {
    width: 90px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--content-bg);
    color: var(--text-color);
}
.qst-year-nav button {
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.qst-year-nav button:hover { opacity: 0.9; }

/* Variante inline: embutida no qst-hero, mais discreta e compacta. */
.qst-year-nav--inline {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
    gap: 8px;
}
.qst-year-nav--inline a { padding: 5px 10px; font-size: 0.9rem; }
.qst-year-nav--inline .qst-year-current { padding: 5px 12px; font-size: 0.95rem; }
.qst-year-nav--inline form { margin-left: 4px; }
.qst-year-nav--inline input[type="number"] { width: 72px; padding: 5px 8px; font-size: 0.85rem; }
.qst-year-nav--inline button { padding: 5px 10px; font-size: 0.85rem; }

/* ───── Master result (destaque principal) ─────────────────────── */
.qst-hero {
    background: var(--content-bg);
    padding: 30px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    margin-top: 15px;
    margin-bottom: 30px;
}
.qst-hero__title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 0 0 8px;
    font-weight: 600;
}
.qst-hero__main {
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 900;
    color: var(--text-color);
    margin: 12px 0;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.qst-hero__extra {
    font-size: clamp(1.4rem, 3.5vw, 2.1rem);
    display: block;
    color: var(--secondary-color);
    margin-top: 4px;
    font-weight: 700;
}
.qst-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}
.qst-hero__chip {
    background: var(--light-bg);
    padding: 7px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qst-hero__chip i { color: var(--primary-color); }

/* ───── Distribuição de dias (6 cards) ──────────────────────────── */
.qst-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.qst-card {
    background: var(--content-bg);
    padding: 22px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    text-align: left;
    transition: transform .15s ease, box-shadow .15s ease;
}
.qst-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.qst-card__icon {
    font-size: 1.8em;
    margin-bottom: 12px;
    display: block;
}
.qst-card__label {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--secondary-color);
    font-weight: 600;
}
.qst-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 6px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.qst-card__desc {
    color: var(--secondary-color);
    font-size: 0.9em;
    line-height: 1.45;
    margin: 0;
}
.qst-card--green   { border-left-color: #10b981; }
.qst-card--green   .qst-card__icon { color: #10b981; }
.qst-card--blue    { border-left-color: #3b82f6; }
.qst-card--blue    .qst-card__icon { color: #3b82f6; }
.qst-card--indigo  { border-left-color: #6366f1; }
.qst-card--indigo  .qst-card__icon { color: #6366f1; }
.qst-card--rose    { border-left-color: #f43f5e; }
.qst-card--rose    .qst-card__icon { color: #f43f5e; }
.qst-card--amber   { border-left-color: #f59e0b; }
.qst-card--amber   .qst-card__icon { color: #f59e0b; }
.qst-card--violet  { border-left-color: #8b5cf6; }
.qst-card--violet  .qst-card__icon { color: #8b5cf6; }

/* ───── Section headers padrão ──────────────────────────────────── */
.qst-section-head {
    margin: 10px 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}
.qst-section-head h2,
.qst-section-head h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin: 0 0 4px;
}
.qst-section-head p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.qst-section-head p em {
    font-style: normal;
    background: var(--light-bg);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: 700;
}

/* ───── Grade anual (12 meses) — segue padrão /calendario ──────── */
.qst-annual-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 8px;
}
@media (max-width: 900px) { .qst-annual-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .qst-annual-grid { grid-template-columns: 1fr; } }

/* Desabilita efeito de hover "clicável" do /calendario — aqui os meses
   não abrem modal individual. */
.qst-annual-grid .month-container.qst-no-hover,
.qst-annual-grid .month-container.qst-no-hover:hover,
.qst-annual-grid .month-container.qst-no-hover:focus {
    cursor: default;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Semana ISO no título do mês (pílula azul) */
.qst-week-range {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: none;
    vertical-align: middle;
}

/* ───── Grade do mês com coluna de semana ───────────────────────── */
/* Sobrescreve .calendar-grid dentro da grade anual: layout em linhas (flex-col),
   cada linha é seu próprio grid 8-col (coluna S + 7 dias) com listra zebrada. */
.qst-annual-grid .calendar-grid.qst-cal-with-weeks {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 10px;
}
.qst-cal-row {
    display: grid;
    grid-template-columns: 56px repeat(7, 1fr);
    gap: 3px;
    padding: 3px 2px;
    align-items: stretch;
    border-radius: 6px;
    transition: background .15s ease;
}
@media (max-width: 480px) {
    /* Em telas muito estreitas, reduz a coluna de semana */
    .qst-cal-row { grid-template-columns: 44px repeat(7, 1fr); }
}

/* Listra zebrada: alterna background em linhas pares, cria grupo visual */
.qst-cal-row:nth-of-type(even) {
    background: rgba(0, 113, 227, 0.05);
}
.qst-cal-row:hover {
    background: rgba(0, 113, 227, 0.12);
}
.qst-cal-row:hover .qst-wk-cell {
    transform: scale(1.05);
}

/* Linha tracejada sutil entre linhas de dados pra reforçar "uma semana por linha" */
.qst-cal-row + .qst-cal-row {
    border-top: 1px dashed rgba(0, 113, 227, 0.14);
    margin-top: 2px;
    padding-top: 5px;
}

/* Cabeçalho da grade (dias da semana + coluna "S") */
.qst-cal-row--head {
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 4px;
}
.qst-cal-row--head:hover { background: transparent; }
.qst-wk-header {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 0.72em;
    text-align: center;
    padding: 4px 2px;
    align-self: center;
    border-right: 2px solid rgba(0, 113, 227, 0.25);
    margin-right: 4px;
    letter-spacing: 0;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .qst-wk-header { font-size: 0.68em; }
    .qst-wk-cell { font-size: 0.68em; }
}

/* Pílula da semana (coluna esquerda de cada linha) */
.qst-wk-cell {
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    padding: 2px 0;
    text-align: center;
    font-weight: 700;
    font-size: 0.72em;
    line-height: 1.2;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0, 113, 227, 0.25);
    /* "Seta" visual apontando pra linha: borda direita saliente */
    border-right: 3px solid rgba(0, 113, 227, 0.45);
    margin-right: 2px;
}

/* Destaque do dia atual (mantém compatibilidade com .weekend/.holiday) */
.calendar-day.qst-today {
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
    background-color: rgba(251, 191, 36, 0.2);
    font-weight: 800;
}

/* ───── Tabela de semanas ISO por mês ──────────────────────────── */
.qst-iso-table-wrap { overflow-x: auto; margin-top: 8px; }
.qst-iso-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 520px;
}
.qst-iso-table thead tr {
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}
.qst-iso-table th {
    padding: 10px 12px;
    font-weight: 700;
    color: var(--secondary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
}
.qst-iso-table th:first-child { text-align: left; }
.qst-iso-table th.qst-iso-table__weeks { color: var(--primary-color); }
.qst-iso-table td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.qst-iso-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}
.qst-iso-table td.qst-iso-table__weeks {
    font-weight: 800;
    color: var(--primary-color);
}
.qst-iso-table tbody tr.qst-iso-table__total {
    border-top: 2px solid var(--border-color);
    background: var(--light-bg);
    font-weight: 800;
}
.qst-iso-table tbody tr.qst-iso-table__total td { border-bottom: 0; }

/* ───── Tabela histórica ───────────────────────────────────────── */
.qst-history-wrap { overflow-x: auto; }
.qst-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    min-width: 520px;
}
.qst-history thead tr {
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}
.qst-history th,
.qst-history td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.qst-history th {
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}
.qst-history th:first-child,
.qst-history td:first-child {
    text-align: left;
    font-weight: 700;
    color: var(--text-color);
}
.qst-history td a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.qst-history td a:hover { text-decoration: underline; }
.qst-history tr.qst-history__current {
    background: rgba(0, 113, 227, 0.08);
    font-weight: 800;
}
.qst-history tr.qst-history__current td:first-child { color: var(--primary-color); }

/* ───── Screen-reader utility ──────────────────────────────────── */
.qst-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ───── Print ───────────────────────────────────────────────────── */
@media print {
    .no-print,
    .qst-year-nav {
        display: none !important;
    }
    .qst-annual-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .month-container { break-inside: avoid; }
    .qst-week-range { background: #000 !important; color: #fff !important; }
}
