/* Certificate HUB - foglio di stile
   Colori del logo: arancio #EC6706, viola #711A62, azzurro #88C1DC, grigio #505050 */
:root {
  --orange: #ec6706; --orange-dark: #d25c05; --orange-soft: #fdf0e6;
  --violet: #711a62; --violet-dark: #5a1450; --violet-soft: #f6edf4;
  --blue: #88c1dc; --blue-soft: #eaf4fa;
  --text: #2b2b2b; --muted: #6b6b70; --title: #505050; --line: #e6e6e8; --bg: #f5f5f6;
  --ok: #2e9e44; --warn: #f0a020; --ko: #d33; --off: #9aa3ad;
  --radius: .5rem; --gap: 1rem;
}

/* Il testo cresce con lo schermo: leggibile da laptop a monitor 4K */
html { font-size: clamp(14px, .35vw + 9px, 20px); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.4; }
a { color: var(--violet); }
h1 { font-size: 1.45rem; margin: .25rem 0 1rem; color: var(--title); }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; color: var(--title); }
code { font-size: .9em; }

/* ---- barra superiore */
.devbar { background: var(--violet); color: #fff; text-align: center; padding: .25rem; font-size: .8rem; }
.topbar { background: var(--orange); color: #fff; display: flex; align-items: center; flex-wrap: wrap;
          gap: .5rem 1.5rem; padding: 0 1.5rem; box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.brand { display: flex; align-items: center; gap: .9rem; padding: .5rem 0; color: #fff; text-decoration: none; }
.brand-logo { background: #fff; border-radius: .4rem; padding: .25rem .5rem; display: flex; }
.brand-logo img { height: 2.4rem; display: block; }
.brand-name { font-weight: 600; font-size: 1.2rem; letter-spacing: .02em; }
.nav { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.nav a { color: #fff; opacity: .85; text-decoration: none; padding: 1.2rem .25rem 1.05rem; border-bottom: 3px solid transparent; }
.nav a:hover { opacity: 1; }
.nav a.on { opacity: 1; font-weight: 600; border-bottom-color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.userbox form { margin: 0; }
.userbox button { background: transparent; border: 1px solid #fff; color: #fff; border-radius: .25rem; padding: .25rem .6rem; cursor: pointer; font: inherit; }
.userbox button:hover { background: rgba(255,255,255,.15); }

/* ---- contenuto: occupa tutta la larghezza disponibile */
.page { padding: 1.25rem 1.5rem; width: 100%; max-width: 3200px; margin: 0 auto; }
.footer { color: #9a9aa0; font-size: .75rem; padding: .6rem 1.5rem 1.5rem; max-width: 3200px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.toolbar h1 { margin-right: auto; }

.card { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08);
        padding: 1rem; margin-bottom: var(--gap); border-top: 3px solid var(--orange); min-width: 0; }
.card > h2:first-child { margin-top: 0; }
.narrow { max-width: 42rem; }
.center { margin: 4rem auto; text-align: center; }

/* Griglie: con pochi clienti le schede si allargano, con molti si affiancano */
.grid-clients { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 40rem), 1fr)); }
.grid-system  { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); }
.grid-clients .card, .grid-system .card { margin-bottom: 0; }
.cols-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr)); align-items: start; }

/* ---- banner e messaggi */
.banner { padding: .6rem .9rem; border-radius: .4rem; margin-bottom: .6rem; color: #fff; }
.banner a { color: #fff; font-weight: 600; }
.banner.green { background: var(--ok); } .banner.orange { background: var(--warn); } .banner.red { background: var(--ko); }
.flash { background: var(--blue-soft); border: 1px solid var(--blue); padding: .6rem .9rem; border-radius: .4rem; margin-bottom: .75rem; }

/* ---- semafori e etichette */
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.sm { width: .5rem; height: .5rem; }
.dot.green { background: var(--ok); } .dot.orange { background: var(--warn); } .dot.red { background: var(--ko); } .dot.grey { background: var(--off); }
.tag { font-size: .75rem; padding: .1rem .5rem; border-radius: 1rem; background: var(--line); white-space: nowrap; }
.tag.active { background: #d8f0dd; } .tag.suspended { background: #ffe9c2; } .tag.disabled { background: #e3e3e3; }
.head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; }
.head .push { margin-left: auto; }
.small, .muted { color: var(--muted); font-size: .8rem; }
.err { color: var(--ko); font-weight: 600; } .ok { color: #2e7d32; font-weight: 600; }
.mt { margin-top: .6rem; }

/* ---- tabelle (scorrono orizzontalmente su schermi stretti) */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: .5rem .65rem; text-align: left; font-size: .9rem; vertical-align: top; }
th { background: var(--orange-soft); font-weight: 600; color: var(--title); white-space: nowrap; }
td.dotcol, th.dotcol { width: 1.5rem; }
td.date { white-space: nowrap; width: 9.5rem; }
pre { background: var(--bg); padding: .5rem; white-space: pre-wrap; font-size: .75rem; max-height: 20rem; overflow: auto; }

/* ---- moduli e pulsanti */
input[type=text], input[type=password], select, textarea {
  padding: .45rem; border: 1px solid #c8c8cc; border-radius: .25rem; font: inherit; font-size: .9rem; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
textarea { width: 100%; min-height: 3.5rem; }
.wide { width: 100%; }
label { font-size: .8rem; color: var(--title); }
.field { margin: 0 0 .8rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.btn { background: var(--violet); color: #fff; border: 0; border-radius: .25rem; padding: .45rem .9rem; cursor: pointer;
       font: inherit; font-size: .9rem; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--violet-dark); }
.btn.secondary { background: #fff; color: var(--violet); border: 1px solid var(--violet); }
.btn.secondary:hover { background: var(--violet-soft); }
.btn.primary { background: var(--orange); } .btn.primary:hover { background: var(--orange-dark); }
.btn.danger { background: #c62828; }

.login-logo img { height: 4rem; }

@media (max-width: 760px) {
  .topbar { padding: 0 .75rem; } .page { padding: 1rem .75rem; }
  .nav a { padding: .6rem .2rem; } .userbox { margin-left: 0; width: 100%; padding-bottom: .5rem; }
}
