/* ============================================================
   dashboard.css — Dashboard e páginas de autenticação
   ============================================================ */

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

:root {
    --bg:       #f5f5f7;
    --surface:  #ffffff;
    --border:   #e2e2e8;
    --text:     #1a1a2e;
    --muted:    #6b7280;
    --accent:   #7c6af5;
    --accent-h: #6654e0;
    --danger:   #ef4444;
    --danger-h: #dc2626;
    --success:  #16a34a;
    --green-bg: #dcfce7;
    --red-bg:   #fee2e2;
    --font:     'Inter', system-ui, sans-serif;
    --radius:   10px;
    --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:0 4px 12px rgba(0,0,0,.10);
}

html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); }

/* ── Auth pages ─────────────────────────── */
.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-card--wide { max-width: 560px; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.auth-logo__icon { font-size: 1.5rem; color: var(--accent); }
.auth-logo__text { font-size: 1rem; font-weight: 700; }
.auth-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.25rem; }
.auth-desc { font-size: .875rem; color: var(--muted); margin-bottom: 1.5rem; margin-top: -.75rem; }
.auth-back { margin-top: 1.25rem; font-size: .8rem; text-align: center; }
.auth-back a { color: var(--muted); text-decoration: none; }
.auth-back a:hover { color: var(--accent); }

/* ── Nav ────────────────────────────────── */
.topnav {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 2rem;
    box-shadow: var(--shadow);
}

.topnav__brand { font-size: .9rem; font-weight: 700; color: var(--accent); }
.topnav__right { display: flex; align-items: center; gap: 1rem; }
.topnav__user { font-size: .8rem; color: var(--muted); }

/* ── Main layout ────────────────────────── */
.dash-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Alerts ─────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
}
.alert--success { background: var(--green-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert--error   { background: var(--red-bg);   color: var(--danger);  border: 1px solid #fecaca; }

/* ── Summary cards ──────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.summary-card--accent { border-color: var(--accent); }

.summary-card__value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
}

.summary-card--accent .summary-card__value { color: var(--accent); }
.summary-card__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ── Progress bar ───────────────────────── */
.progress-outer {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #4ade80);
    border-radius: 99px;
    transition: width .6s ease;
}

/* ── Cards / Sections ───────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.card--full { width: 100%; }
.card__title { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 1rem; }

/* ── Forms ──────────────────────────────── */
.form { display: flex; flex-direction: column; gap: .875rem; }
.form--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.form--inline .form-group { flex: 1 1 180px; }
.form--inline .btn { flex-shrink: 0; }

.form-row { display: flex; gap: .75rem; }
.form-row .form-group { flex: 1; }

.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--muted); }

.form-input {
    padding: .6rem .875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,106,245,.15); }

.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.fieldset__legend { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 .5rem; }

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s, opacity .2s;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary   { background: var(--accent);  color: #fff; }
.btn--primary:hover { background: var(--accent-h); }
.btn--secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: #e9e9ef; }
.btn--danger    { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn--danger:hover { background: var(--red-bg); }
.btn--ghost     { background: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); }
.btn--full      { width: 100%; }
.btn--sm        { padding: .3rem .6rem; font-size: .75rem; border-radius: 6px; }

/* ── Prediction ─────────────────────────── */
.prediction { display: flex; flex-direction: column; gap: .5rem; }
.prediction__date { font-size: 2.25rem; font-weight: 800; color: var(--accent); }
.prediction__sub  { font-size: .75rem; color: var(--muted); margin-top: -.25rem; }
.prediction__stats { list-style: none; display: flex; flex-direction: column; gap: .35rem; font-size: .875rem; margin-top: .5rem; }

/* ── Badges ─────────────────────────────── */
.badge { display: inline-block; padding: .2em .55em; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge--green  { background: var(--green-bg); color: var(--success); }
.badge--yellow { background: #fef9c3; color: #854d0e; }
.badge--gray   { background: var(--border); color: var(--muted); }

/* ── Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .65rem .875rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg); }

/* ── Chart ──────────────────────────────── */
.chart-wrap { position: relative; height: 220px; }

/* ── Misc ───────────────────────────────── */
.text-muted { font-size: .875rem; color: var(--muted); }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); font-size: .95rem; }

@media (max-width: 640px) {
    .topnav { padding: .75rem 1rem; }
    .dash-main { padding: 1rem; gap: 1rem; }
    .form-row { flex-direction: column; }
    .form--inline { flex-direction: column; }
    .summary-card__value { font-size: 1.5rem; }
}
