:root {
    --brand: #2f73c2;       /* blu Web Walker / Translate.One */
    --brand-2: #255d9e;     /* hover, tono piu' scuro */
    --ink: #5e5e5e;         /* grigio wordmark */
    --eyebrow: #a3a9b0;     /* grigio chiaro eyebrow */
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1e272e;
    --muted: #7f8c8d;
    --err: #c0392b;
    --ok: #27ae60;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--brand);
    color: #fff;
    padding: 0 1.5rem;
    height: 56px;
}

.topbar .brand { display: flex; align-items: center; text-decoration: none; }
.topbar .brand img { display: block; height: 30px; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar .user { opacity: .85; font-size: .9rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 0; }

h1 { color: var(--brand); }

.auth-card {
    max-width: 360px;
    margin: 4rem auto;
    background: var(--card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.auth-card { text-align: center; }
.auth-logo { display: block; margin: 0 auto 1.25rem; max-width: 70%; height: auto; }
.auth-card h1 { margin-top: 0; font-size: 1.15rem; color: var(--ink); }
.auth-card form { text-align: left; }

form label { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }
form input {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .6rem .7rem;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 1rem;
}
button {
    background: var(--brand);
    color: #fff;
    border: 0;
    padding: .65rem 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
button:hover { background: var(--brand-2); }

.alert { padding: .6rem .8rem; border-radius: 6px; font-size: .9rem; }
.alert-error { background: #fdeaea; color: var(--err); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border-radius: 10px; padding: 1.2rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.card .num { display: block; font-size: 2rem; font-weight: 700; color: var(--brand); }
.card .lbl { color: var(--muted); font-size: .85rem; }

.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .8rem; }

/* Pannelli / form */
.panel { background: var(--card); border-radius: 10px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); max-width: 720px; }
.btn-secondary { display: inline-block; padding: .55rem 1rem; border: 1px solid #cfd8dc; border-radius: 6px; color: var(--brand); text-decoration: none; margin-left: .5rem; }
.btn-secondary:hover { background: #f0f4f8; }
button:disabled { background: #b0bec5; cursor: not-allowed; }
.req { color: var(--err); font-weight: 700; }

/* Tabella di mappatura import */
.map-table, .data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.map-table th, .map-table td, .data-table th, .data-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid #eceff1; vertical-align: top; }
.map-table th, .data-table th { background: #f5f7f9; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.map-select { width: 100%; padding: .45rem; border: 1px solid #dfe6e9; border-radius: 6px; }
.preview { font-size: .82rem; color: var(--muted); }
.preview-row { padding: .15rem 0; border-bottom: 1px dashed #eceff1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* Badge */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-nominativo { background: #fff3e0; color: #e65100; }
.badge-generico { background: #e8f5e9; color: #2e7d32; }
.badge-assente { background: #eceff1; color: #607d8b; }
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-warn { background: #fff8e1; color: #f57f17; }
.badge-pass { background: #e8f5e9; color: #2e7d32; }
.badge-fail { background: #fdeaea; color: #c0392b; }
.badge-na { background: #eceff1; color: #607d8b; }

.data-table a { color: var(--brand); }
.btn-mini { padding: .3rem .7rem; font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--brand); }

/* Liste / toolbar M5 */
a.card { text-decoration: none; color: inherit; transition: box-shadow .15s; }
a.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.searchbar { display: flex; gap: .4rem; align-items: center; }
.searchbar input { padding: .45rem .7rem; border: 1px solid #dfe6e9; border-radius: 6px; min-width: 260px; }
.bulkbar { display: flex; align-items: center; gap: .6rem; margin: .5rem 0; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.2rem 0; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; background: #bbb; }
.dot-na { background: #cfd8dc; }
.alert-ok { background: #e8f5e9; color: #2e7d32; }
.alert-warn { background: #fff8e1; color: #f57f17; }
h2 { color: var(--brand); }

.scorebanner { display: flex; align-items: center; gap: 1.2rem; background: var(--card); border-radius: 10px; padding: 1.2rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); margin: 1rem 0; }
.scorebig { font-size: 3rem; font-weight: 800; line-height: 1; }
.scorebig small { font-size: 1.1rem; color: var(--muted); }
.sem-pill { display: inline-block; padding: .3rem .8rem; border-radius: 999px; color: #fff; font-weight: 700; font-size: .85rem; }
code { background: #f0f4f8; padding: .1rem .35rem; border-radius: 4px; font-size: .85rem; }
