/* =========================================================
   ODT Transfer - foglio di stile
   ========================================================= */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e3e5e9;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #0f7b3f;
  --ok-bg: #e7f6ed;
  --err: #b42318;
  --err-bg: #fdecea;
  --warn-bg: #fff7e6;
  --warn: #92400e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1c1f25;
    --ink: #e8eaed;
    --muted: #9aa1ad;
    --line: #2c313a;
    --ok-bg: #16301f;
    --err-bg: #341c19;
    --warn-bg: #33270f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 48px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 15.5px; white-space: nowrap; }
.brand-mark { margin-right: 4px; }
.nav { display: flex; gap: 18px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--brand); }
.me { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.me-name { font-size: 13px; color: var(--muted); text-decoration: none; }
.me-name:hover { color: var(--brand); }
.tag {
  background: var(--brand); color: #fff; border-radius: 4px;
  font-size: 10px; padding: 1px 5px; margin-left: 4px;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.inline { display: inline; }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h1 { font-size: 20px; margin: 0 0 4px; }
.card h2 { font-size: 16px; margin: 0 0 14px; }
.card > p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.card-narrow { max-width: 420px; margin: 6vh auto 0; }

/* ---------- Form ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
textarea { resize: vertical; min-height: 74px; }
.field { margin-bottom: 16px; }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.check input { margin-top: 3px; }
.check label { margin: 0; font-weight: 500; }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0;
  padding: 10px 18px; border-radius: 7px; font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger { background: var(--err); }
.btn-danger:hover:not(:disabled) { background: #91231b; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-link {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; padding: 0; text-decoration: underline;
}
.btn-link:hover { color: var(--brand); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

/* ---------- Flash ---------- */
.flash {
  padding: 11px 14px; border-radius: 8px; margin-bottom: 16px;
  font-size: 14px; border: 1px solid transparent;
}
.flash-ok  { background: var(--ok-bg);  color: var(--ok);  border-color: rgba(15, 123, 63, .25); }
.flash-err { background: var(--err-bg); color: var(--err); border-color: rgba(180, 35, 24, .25); }

/* ---------- Dropzone ---------- */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; background: var(--bg);
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--brand); background: rgba(37, 99, 235, .06); }
.drop-icon { font-size: 34px; line-height: 1; }
.drop-title { font-weight: 600; margin: 10px 0 4px; }
.drop-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.drop-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Lista file ---------- */
.files { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.files-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 13px; background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}
.files-body { max-height: 340px; overflow-y: auto; }
.frow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 13px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.frow:last-child { border-bottom: 0; }
.frow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.frow-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.frow-state { width: 76px; text-align: right; font-size: 12px; white-space: nowrap; }
.frow-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.frow-x:hover { color: var(--err); }
.state-wait { color: var(--muted); }
.state-up   { color: var(--brand); font-weight: 600; }
.state-ok   { color: var(--ok); font-weight: 600; }
.state-err  { color: var(--err); font-weight: 600; }

/* ---------- Barra di avanzamento ---------- */
.bar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.prog { margin-top: 18px; }
.prog-txt { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 7px; }

/* ---------- Tabelle ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; font-weight: 700;
}
.tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl a { color: var(--brand); text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.pill-ok  { background: var(--ok-bg); color: var(--ok); }
.pill-off { background: var(--err-bg); color: var(--err); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); font-size: 14px; }

.notice {
  background: var(--warn-bg); border: 1px solid rgba(146, 64, 14, .25); color: var(--warn);
  padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px;
}
.copybox {
  display: flex; gap: 8px; margin-top: 8px;
}
.copybox input { font-family: ui-monospace, monospace; font-size: 12px; }

.stats { display: flex; gap: 26px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-n { font-size: 21px; font-weight: 700; }
.stat-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.pager a, .pager span {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px;
  text-decoration: none; color: var(--ink); font-size: 13px;
}
.pager .on { background: var(--brand); color: #fff; border-color: var(--brand); }

.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; text-align: center; }

@media (max-width: 640px) {
  .topbar-in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .me { margin-left: auto; }
  .hide-sm { display: none; }
}
