/* ReportDay — interface no design system BMW M (DESIGN-bmw-m.md)
   Canvas preto, tipografia pesada (700) × leve (300), cantos retos,
   stripe tricolor apenas como assinatura de marca. */

:root {
    color-scheme: dark; /* widgets nativos (date/month/number) em tema escuro */
    --canvas: #000000;
    --surface-soft: #0d0d0d;
    --surface-card: #1a1a1a;
    --surface-elevated: #262626;
    --hairline: #3c3c3c;
    --ink: #ffffff;
    --body: #bbbbbb;
    --body-strong: #e6e6e6;
    --muted: #7e7e7e;
    --m-blue-light: #0066b1;
    --m-blue-dark: #1c69d4;
    --m-red: #e22718;
    --warning: #f4b400;
    --success: #0fa336;
    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

body {
    background: var(--canvas);
    color: var(--body);
    font-family: var(--font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3 { color: var(--ink); font-weight: 700; text-transform: uppercase; }
h1 { font-size: 56px; line-height: 1.05; letter-spacing: -0.5px; }
h2 { font-size: 32px; line-height: 1.15; margin-bottom: 24px; }
h3 { font-size: 20px; line-height: 1.3; }

.label-uppercase {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Navegação ---- */
.top-nav {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 0 24px;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
}
.brand-stripe { display: flex; height: 16px; }
.brand-stripe i { width: 5px; }
.m-stripe { display: flex; height: 4px; }
.m-stripe i { flex: 1; }
.brand-stripe i:nth-child(1), .m-stripe i:nth-child(1) { background: var(--m-blue-light); }
.brand-stripe i:nth-child(2), .m-stripe i:nth-child(2) { background: var(--m-blue-dark); }
.brand-stripe i:nth-child(3), .m-stripe i:nth-child(3) { background: var(--m-red); }

.main-nav { display: flex; gap: 24px; align-items: center; }
.nav-auth { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-auth a { color: var(--body); font-size: 14px; letter-spacing: 0.5px; text-decoration: none; }
.nav-auth a.active, .nav-auth a:hover { color: var(--ink); }
.login-panel { max-width: 440px; }
.login-form { display: flex; flex-direction: column; gap: 24px; align-items: stretch; }
.main-nav a, .nav-soon { font-size: 14px; letter-spacing: 0.5px; text-decoration: none; }
.main-nav a { color: var(--body); }
.main-nav a.active { color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.nav-soon { color: var(--muted); cursor: default; }
.nav-soon::after { content: " ·"; color: var(--hairline); }

/* ---- Hero ---- */
.hero { padding: 64px 0 40px; }
.hero .lead { color: var(--body-strong); font-size: 18px; max-width: 720px; margin-top: 16px; }
.hero .label-uppercase { margin-bottom: 8px; }

/* ---- Células de indicadores ---- */
.spec-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    margin-bottom: 64px;
}
.spec-cell {
    background: var(--surface-soft);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.spec-cell strong { color: var(--ink); font-size: 32px; font-weight: 700; line-height: 1.15; }

/* ---- Cards de time ---- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 96px;
}
.team-card {
    background: var(--surface-card);
    padding: 24px;
    border-top: 4px solid var(--m-blue-dark);
}
.team-card.inactive { opacity: 0.55; border-top-color: var(--hairline); }
.team-card header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.team-unit { margin-bottom: 16px; }

.badge {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
}
.badge-on { color: var(--success); border: 1px solid var(--success); }
.badge-off { color: var(--muted); border: 1px solid var(--hairline); }

.user-list { list-style: none; }
.user-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 14px;
}
.user-list li:last-child { border-bottom: none; }
.user-list li.inactive { color: var(--muted); }
.user-name { color: var(--body-strong); }
.user-list li.inactive .user-name { color: var(--muted); }
.user-goal { text-align: right; white-space: nowrap; }

/* ---- Alertas ---- */
.alert {
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    border-left: 4px solid;
    background: var(--surface-card);
}
.alert-success { border-color: var(--success); color: var(--body-strong); }
.alert-warning { border-color: var(--warning); color: var(--body-strong); }
.alert-error   { border-color: var(--m-red); color: var(--body-strong); }
.alert-slim    { margin: 8px 0; padding: 8px 12px; color: var(--body); }

/* ---- Formulários ---- */
input[type="date"], input[type="month"], input[type="time"], input[type="file"],
input[type="text"], input[type="number"], select, textarea {
    background: var(--surface-card);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 0;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 14px;
    height: 48px;
}
input[type="file"] { padding: 10px 12px; }
input[type="date"], input[type="month"] { min-width: 175px; line-height: normal; }
input[type="date"].input-sm, input[type="month"].input-sm { min-width: 150px; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { opacity: 0.7; cursor: pointer; }
input[type="number"].input-sm { width: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }

.btn {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 0;
    padding: 0 32px;
    height: 48px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
}
.btn:hover { background: var(--surface-elevated); }
.btn-primary { background: var(--ink); color: var(--canvas); }
.btn-primary:hover { background: var(--body-strong); }

/* ---- Cabeçalho de página ---- */
.page-head { padding: 48px 0 32px; }
.page-head .lead { color: var(--body-strong); font-size: 18px; max-width: 720px; margin-top: 16px; }
.page-head .label-uppercase { margin-bottom: 8px; }

/* ---- Painéis e formulários em linha ---- */
.panel {
    background: var(--surface-soft);
    border: 1px solid var(--hairline);
    padding: 24px;
    margin-bottom: 40px;
}
.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 8px; }

/* ---- Slots de importação ---- */
.slot-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 96px;
}
.import-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    background: var(--surface-card);
    border-top: 4px solid var(--m-blue-dark);
    padding: 32px;
}
.slot-info .label-uppercase { margin-top: 4px; }
.slot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--muted);
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hairline);
    flex-shrink: 0;
}
.dot-ok { background: var(--success); }

.upload-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* campo de arquivo customizado */
.file-field {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.file-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.file-btn {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 24px;
    border: 1px solid var(--hairline);
    background: var(--surface-elevated);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.file-field:hover .file-btn { border-color: var(--ink); }
.file-name {
    font-size: 13px;
    color: var(--muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-name.has-file { color: var(--body-strong); }

/* ---- Tabelas de dados ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}
.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--hairline);
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface-elevated);
    color: var(--body-strong);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; white-space: nowrap; }

/* ---- Abas ---- */
.tab-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.tab-nav a {
    padding: 12px 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--body);
    border-bottom: 2px solid transparent;
}
.tab-nav a.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- Admin: tabelas e formulários compactos ---- */
.panel-table { background: var(--surface-card); margin-bottom: 96px; }
.panel-table th { padding: 16px 16px 8px; }
.panel-table td { padding: 12px 16px; }
.row-inactive td { color: var(--muted); }
.muted-text { color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }
.hint { margin-top: 16px; font-size: 13px; color: var(--muted); max-width: 720px; }
.field-grow { flex: 1; min-width: 220px; }

.input-sm, select.input-sm, input.input-sm { height: 36px; padding: 4px 10px; font-size: 13px; }
input.num { width: 90px; text-align: right; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 12px; letter-spacing: 1px; }

.cell-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.audit-changes code {
    font-size: 12px;
    color: var(--body);
    word-break: break-word;
    display: block;
    max-width: 560px;
}

/* ---- Report do dia ---- */
.obs-form textarea { width: 100%; min-height: 64px; height: auto; resize: vertical; }
.obs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.report-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0 24px;
    flex-wrap: wrap;
}
.report-columns {
    display: grid;
    grid-template-columns: 720px minmax(320px, 1fr);
    gap: 40px;
    align-items: start;
    margin-bottom: 96px;
}
.report-preview { overflow-x: auto; }
.report-text .label-uppercase { margin-bottom: 12px; }
.wa-text {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    color: var(--body-strong);
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 24px;
    white-space: pre-wrap;
    word-break: break-word;
}
@media (max-width: 1180px) {
    .report-columns { grid-template-columns: 1fr; }
}

/* ---- Dashboards ---- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
    margin-bottom: 96px;
}
.dash-card {
    background: var(--surface-card);
    border-top: 4px solid var(--m-blue-dark);
    padding: 24px;
}
.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.text-link {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}
.text-link:hover { color: var(--body-strong); }

.dash-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    margin-bottom: 16px;
}
.dash-metric {
    background: var(--surface-soft);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dash-metric strong { color: var(--ink); font-size: 22px; font-weight: 700; }
.dash-metric .label-uppercase { font-size: 11px; letter-spacing: 1px; }
.metric-ok strong { color: var(--success); }
.metric-low strong { color: var(--warning); }
.cell-ok strong { color: var(--success); }
.cell-low strong { color: var(--warning); }
.spec-row-5 { grid-template-columns: repeat(5, 1fr); margin-bottom: 64px; }

.dash-people { list-style: none; }
.dash-people li {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto 120px;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--surface-elevated);
    font-size: 14px;
}
.dash-people li:last-child { border-bottom: none; }
.dash-person-name { color: var(--body-strong); }
.dash-person-nums { color: var(--muted); font-size: 13px; white-space: nowrap; }

.hbar {
    display: block;
    background: var(--surface-elevated);
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}
.hbar i { display: block; height: 100%; background: var(--m-blue-dark); }
.hbar i.hbar-ok { background: var(--success); }
.dash-people .hbar { margin-top: 0; }

/* gráfico de barras diário (CSS puro) */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 200px;
    background: var(--surface-card);
    padding: 24px 16px 8px;
    margin-bottom: 8px;
}
.c-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    height: 100%;
    min-width: 0;
}
.c-col i { display: block; background: var(--m-blue-dark); }
.c-col i.c-ok { background: var(--success); }
.c-col.c-off { opacity: 0.45; }
.c-lbl {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    margin-top: 4px;
}
.c-val {
    font-size: 10px;
    color: var(--body-strong);
    text-align: center;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}
section > .hint { margin-bottom: 64px; }

@media (max-width: 900px) {
    .spec-row-5 { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
}

/* ---- Rodapé ---- */
.footer {
    border-top: 1px solid var(--hairline);
    padding: 24px 0;
    font-size: 14px;
    color: var(--muted);
}
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 900px) {
    h1 { font-size: 40px; }
    .spec-row { grid-template-columns: repeat(2, 1fr); }
    .main-nav { display: none; }
}
