/* ============================================================
   Design system do starter kit.
   Referência: Z:\IdiomaDaAlma\pitch-onepager.html
   Cartão branco central sobre fundo slate escuro, hero teal.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #1e293b;
    padding: 20px;
    min-height: 100vh;
}

.page {
    max-width: 840px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}

/* Cartão estreito para telas de autenticação (login, esqueci senha, token, etc.). */
.page-narrow { max-width: 440px; }
.page-narrow .form { max-width: none; }

/* ---------------------------------------------------------- Hero */
.hero {
    background: linear-gradient(135deg, #0f766e, #134e4a);
    color: #fff;
    padding: 28px 34px;
}
.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.tagline { font-size: .9rem; color: #5eead4; margin-top: 4px; }

.hero-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lang { display: flex; gap: 6px; }
.lang-link {
    color: #c7fff4;
    text-decoration: none;
    font-size: .78rem;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .25);
}
.lang-link.is-active { background: #5eead4; color: #134e4a; font-weight: 700; border-color: #5eead4; }
.logout-form { margin: 0; }
.btn-link {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    font-size: .8rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.btn-link:hover { background: rgba(255, 255, 255, .12); }

/* ---------------------------------------------------------- Flash */
.flash { padding: 12px 34px; font-size: .88rem; border-bottom: 1px solid #f1f5f9; }
.flash-success { background: #f0fdfa; color: #0f766e; }
.flash-error { background: #fef2f2; color: #b91c1c; }

/* ---------------------------------------------------------- Seções */
.sec { padding: 26px 34px; border-bottom: 1px solid #f1f5f9; }
.sec:last-child { border-bottom: none; }
.sec h2 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0f766e;
    font-weight: 800;
    margin-bottom: 14px;
}
.sec p { font-size: .92rem; line-height: 1.55; color: #334155; }
.sec h1 { font-size: 1.4rem; color: #0f172a; margin-bottom: 8px; }

/* ---------------------------------------------------------- Formulários */
.form { max-width: 420px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: #334155; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: .92rem;
    background: #fff;
    color: #1e293b;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #334155; }
.check input { width: auto; }

.btn {
    display: inline-block;
    background: #0f766e;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #0d5f59; }
.btn-block { width: 100%; }

.links { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.links a { color: #0f766e; font-size: .85rem; text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- Cartões */
.card { background: #f0fdfa; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px; }
.badge {
    display: inline-block;
    background: #0f766e;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

/* ---------------------------------------------------------- Foot */
.foot { background: #f0fdfa; padding: 16px 34px; text-align: center; font-size: .78rem; color: #475569; }

/* ---------------------------------------------------------- Nav */
.mainnav {
    display: flex;
    gap: 4px;
    padding: 0 22px;
    background: #134e4a;
    border-bottom: 1px solid #0b3b37;
}
.mainnav a {
    color: #c7fff4;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 3px solid transparent;
}
.mainnav a:hover { color: #fff; }
.mainnav a.is-active { color: #fff; border-bottom-color: #5eead4; }

/* ---------------------------------------------------------- Cabeçalho de seção */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.sec-head h1 { margin: 0; }

/* ---------------------------------------------------------- Toolbar (busca/filtros) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.toolbar input[type="text"], .toolbar select {
    padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: .85rem; background: #fff; color: #1e293b;
}
.toolbar input[type="text"] { min-width: 200px; flex: 1 1 200px; }
.toolbar-spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------- Tabela de dados */
.table-wrap { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef2f6; overflow-wrap: anywhere; word-break: break-word; }
.data-table thead th { background: #f0fdfa; color: #0f766e; font-size: .76rem; text-transform: uppercase; letter-spacing: .5px; }
.data-table thead th a { color: #0f766e; text-decoration: none; }
.data-table thead th a:hover { text-decoration: underline; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .col-actions { text-align: right; }
.data-table .col-actions .btn-sm { margin-bottom: 4px; }
.data-table .empty { text-align: center; color: #94a3b8; padding: 24px; }

.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pill-on { background: #dcfce7; color: #15803d; }
.pill-off { background: #fee2e2; color: #b91c1c; }

/* ---------------------------------------------------------- Paginação */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: .82rem; color: #475569; }
.pag-size select { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 8px; margin-left: 4px; }
.pag-pages { display: flex; align-items: center; gap: 8px; }
.pag-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #cbd5e1; border-radius: 8px; color: #0f766e; text-decoration: none; font-weight: 700; }
.pag-btn:hover { background: #f0fdfa; }
.pag-btn.is-disabled { color: #cbd5e1; pointer-events: none; }

/* ---------------------------------------------------------- Botões auxiliares */
.btn-ghost { display: inline-block; padding: 8px 14px; border: 1px solid #0f766e; border-radius: 10px; color: #0f766e; background: #fff; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-ghost:hover { background: #f0fdfa; }
.btn-sm { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600; text-decoration: none; border: 1px solid #cbd5e1; color: #334155; background: #fff; cursor: pointer; }
.btn-sm:hover { background: #f8fafc; }
.btn-danger { border-color: #fca5a5; color: #b91c1c; }
.btn-danger:hover { background: #fef2f2; }
.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------- Mobile */
@media (max-width: 620px) {
    .hero-top { flex-direction: column; }
    .sec, .hero, .flash, .foot { padding-left: 22px; padding-right: 22px; }
    .mainnav { overflow-x: auto; }
    .toolbar input[type="text"] { flex-basis: 100%; }
    .sec-head { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Controle de Notas — acréscimos ao design system do starter kit
   ============================================================ */
.page { max-width: 1000px; }
.page-narrow { max-width: 440px; }

.who { font-size: .8rem; color: #c7fff4; }
a.btn-link { text-decoration: none; display: inline-block; }
.muted { color: #64748b; font-size: .82rem; }
.hint { display: block; margin-top: 5px; font-size: .76rem; color: #64748b; line-height: 1.4; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
code { font-family: Consolas, 'Courier New', monospace; font-size: .74rem; color: #475569; overflow-wrap: anywhere; }

/* Formulários */
.form-wide { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field input[type="date"], .field input[type="file"], .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 10px;
    font-size: .92rem; font-family: inherit; background: #fff; color: #1e293b;
}
.field textarea { resize: vertical; }
.field textarea:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.btn:focus-visible, .btn-ghost:focus-visible, .btn-sm:focus-visible, .btn-link:focus-visible,
a:focus-visible, summary:focus-visible { outline: 3px solid #5eead4; outline-offset: 2px; }
.btn-warn { background: #b91c1c; }
.btn-warn:hover { background: #991b1b; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }

.toolbar input[type="date"] { padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: .85rem; font-family: inherit; }
.tb-date { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #475569; }
.toolbar select { max-width: 220px; }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: #f0fdfa; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit; }
a.stat:hover { border-color: #0f766e; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; color: #0f766e; font-weight: 800; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: #64748b; }
.stat-warn { background: #fef2f2; border-color: #fecaca; }
.stat-warn .stat-label { color: #b91c1c; }

/* Situação da nota */
.st-pendente { background: #fef3c7; color: #92400e; }
.st-paga { background: #dcfce7; color: #15803d; }
.st-cancelada { background: #e2e8f0; color: #475569; }
.sec h1 .pill { vertical-align: middle; margin-left: 6px; }

/* Detalhe */
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.details .full { grid-column: 1 / -1; }
.details dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #64748b; font-weight: 700; margin-bottom: 3px; }
.details dd { font-size: .95rem; color: #1e293b; overflow-wrap: anywhere; }
.details dd.big { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.copyable { user-select: all; }
.sec-action { background: #f0fdfa; }

.files { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px;
    border: 1px solid #e2e8f0; border-radius: 10px; font-size: .88rem; }
.files a { color: #0f766e; font-weight: 600; overflow-wrap: anywhere; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; color: #0f766e; font-weight: 600; font-size: .88rem; margin-bottom: 12px; }

.timeline { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.timeline li { border-left: 3px solid #5eead4; padding: 2px 0 2px 12px; font-size: .86rem; display: flex; flex-direction: column; gap: 2px; }

/* Seletor dia / semana / mês */
.seg { display: inline-flex; border: 1px solid #0f766e; border-radius: 10px; overflow: hidden; }
.seg a { padding: 8px 16px; font-size: .85rem; font-weight: 600; color: #0f766e; text-decoration: none; }
.seg a + a { border-left: 1px solid #0f766e; }
.seg a.is-active { background: #0f766e; color: #fff; }
.total-row td { font-weight: 800; background: #f0fdfa; }

/* Celular: cada linha da tabela vira um cartão, sem rolagem horizontal */
@media (max-width: 620px) {
    body { padding: 10px; }
    .grid-2, .stats, .details { grid-template-columns: 1fr; }
    .mainnav { padding: 0 8px; }
    .mainnav a { white-space: nowrap; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; }
    .data-table tbody tr:last-child { border-bottom: none; }
    .data-table td { border: none; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .data-table td[data-label]::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase;
        letter-spacing: .4px; color: #64748b; font-weight: 700; text-align: left; flex: 0 0 auto; }
    .data-table td.col-actions { justify-content: flex-end; padding-top: 8px; }
    .data-table td.empty { display: block; text-align: center; }
    .toolbar select, .tb-date, .tb-date input { max-width: none; flex: 1 1 100%; }
}

/* Tabelas: palavras, datas, valores e botões nunca partem no meio; só texto longo quebra. */
.data-table thead th { overflow-wrap: normal; word-break: normal; hyphens: none; }
.data-table th, .data-table td { padding: 10px 9px; word-break: normal; }
.nw, .pill, .btn-sm, .badge { white-space: nowrap; }
