/* DISBIT Account e Console - identità visiva DISBIT */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/brand/inter-latin-var.woff2) format("woff2");
}
:root {
  --night: #1d1830;
  --night-2: #2a2342;
  --orange: #f0913f;
  --bg: #faf8f4;
  --card: #ffffff;
  --ink: #1d1830;
  --muted: #6b6680;
  --line: #e6e1d8;
  --brand: #b85c10;
  --brand-soft: #fbeadb;
  --teal: #137a66;
  --teal-soft: #e3f1ed;
  --ok: #2f7d32;
  --ok-soft: #e5f2e3;
  --warn: #a8520b;
  --warn-soft: #fbeadb;
  --err: #c43c3b;
  --err-soft: #fbe5e4;
  --info-soft: #ebe8f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 24, 48, .04), 0 4px 16px rgba(29, 24, 48, .05);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; min-height: 100vh; font-size: 15px; line-height: 1.45; }
a { color: var(--teal); }
h1 { font-size: 1.4rem; margin: 0 0 .3rem; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 1.4rem 0 .7rem; }
h3 { font-size: .98rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; }
.hidden { display: none !important; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 700; color: var(--muted); }

/* ---------- pulsanti e campi */
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: .62rem 1rem; cursor: pointer;
  background: var(--brand); color: #fff; display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; line-height: 1.2;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:disabled { opacity: .55; cursor: default; }
button.secondary, .btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--teal); padding: .35rem .5rem; }
button.danger { background: var(--err); }
button.small, .btn.small { padding: .38rem .7rem; font-size: .85rem; border-radius: 8px; }
label { display: block; font-size: .85rem; font-weight: 600; margin: .8rem 0 .3rem; }
label .muted { font-weight: 400; }
input, select, textarea {
  font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- accesso */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side {
  background: var(--night); color: #f5f2ec; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-side h2 { font-size: 2rem; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.02em; max-width: 16ch; }
.auth-side h2 b { color: var(--orange); }
.auth-side p { color: #c9c3d8; max-width: 38ch; margin: 0; }
.auth-side .apps { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.auth-side .apps span { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: .3rem .75rem; font-size: .82rem; color: #e6e1f0; }
.auth-side .lines { position: absolute; inset: auto -10% -6% -10%; height: 45%; opacity: .5; pointer-events: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card form button[type=submit] { width: 100%; justify-content: center; margin-top: 1.2rem; padding: .75rem; }
.auth-logo { height: 30px; display: block; margin-bottom: 2rem; }
.auth-side .auth-logo { height: 30px; margin: 0; }
main.auth.solo { display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.notice { border-radius: 10px; padding: .75rem .9rem; margin: 1rem 0; font-size: .92rem; }
.notice.err { background: var(--err-soft); color: #8a2423; }
.notice.ok { background: var(--ok-soft); color: #1f5a22; }
.notice.info { background: var(--info-soft); color: #3b3460; }
.notice.warn { background: var(--warn-soft); color: #7a3b06; }
.app-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: .25rem .7rem; font-weight: 600; font-size: .85rem; margin-bottom: .9rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.5rem; }
.pw-wrap button { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); }

/* ---------- area personale e console */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--night); color: #e6e1f0; display: flex; flex-direction: column; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: .2rem .6rem 1.4rem; display: flex; flex-direction: column; gap: .35rem; }
.sidebar .logo img { height: 24px; width: auto; align-self: flex-start; }
.sidebar .logo span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #a49dbb; font-weight: 600; }
.sidebar nav a {
  display: flex; align-items: center; gap: .6rem; color: #d6d0e4; text-decoration: none; padding: .55rem .7rem; border-radius: 9px; font-weight: 500; font-size: .93rem;
}
.sidebar nav a:hover { background: var(--night-2); color: #fff; }
.sidebar nav a.active { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.sidebar nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: .7rem .4rem; }
.sidebar .me { margin-top: auto; padding: .8rem .7rem 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; color: #a49dbb; }
.sidebar .me b { display: block; color: #f5f2ec; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me button { margin-top: .5rem; background: transparent; color: var(--orange); padding: 0; font-size: .85rem; }
.content { padding: 1.8rem 2.2rem 3rem; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head p { margin: 0; }
.crumb { font-size: .85rem; margin-bottom: .3rem; }
.crumb a { text-decoration: none; }
.mobile-bar { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpi .card { padding: 1rem 1.1rem; }
.kpi .val { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; }
.kpi .sub { font-size: .82rem; color: var(--muted); }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .62rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf9f5; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: .16rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: #4b437a; }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.muted { background: #efece6; color: var(--muted); }

.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: .35rem 1rem; font-size: .92rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

.my-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.my-app { display: flex; flex-direction: column; gap: .5rem; }
.my-app .name { font-weight: 700; font-size: 1.05rem; }
.my-app .name small { display: block; font-weight: 500; color: var(--muted); font-size: .82rem; }
.my-app .btn { align-self: flex-start; margin-top: .4rem; }

.secret { background: #f4f1ea; border: 1px dashed #cfc7b8; border-radius: 10px; padding: .8rem; font-family: ui-monospace, Consolas, monospace; font-size: 1rem; word-break: break-all; white-space: pre-wrap; margin: .6rem 0; user-select: all; }

/* ---------- finestre e avvisi */
.modal-bg { position: fixed; inset: 0; background: rgba(29, 24, 48, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 1rem; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border-radius: 16px; padding: 1.3rem 1.4rem; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(29,24,48,.25); }
.modal.wide { max-width: 760px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.3rem; }
#toast { position: fixed; bottom: 1.2rem; right: 1.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 80; }
.toast { background: var(--night); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: .92rem; }
.toast.err { background: var(--err); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-main { align-items: flex-start; }
  .auth-side { padding: 1.6rem 1.25rem; }
  .auth-side h2 { font-size: 1.4rem; margin-top: 1.4rem; }
  .auth-side p, .auth-side .apps, .auth-side .lines { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 40; }
  .shell.open .sidebar { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--night); padding: .7rem 1rem; position: sticky; top: 0; z-index: 30; }
  .mobile-bar img { height: 22px; }
  .mobile-bar button { background: transparent; color: #fff; padding: .3rem .5rem; font-size: 1.3rem; }
  .content { padding: 1.2rem 1rem 3rem; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: .4rem; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
}
