/* ==========================================================================
   AlloggiatiOK — PWA host (mobile-first). Palette indigo coerente con l'admin.
   ========================================================================== */
.aok-app {
    --p: #4f46e5; --p600: #4338ca; --p050: #eef2ff;
    --ink: #1e1b2e; --muted: #6b7280; --line: #e9e8f0;
    --bg: #f6f6fb; --card: #fff; --ok: #15803d; --ok-bg: #ecfdf3; --err: #b42318; --err-bg: #fef3f2;
    --r: 16px; --rs: 12px;
    font-family: "Nunito", ui-rounded, "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.aok-app *, .aok-app *::before, .aok-app *::after { box-sizing: border-box; }

/* Layout */
.aok-app-shell { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.aok-app-top {
    position: sticky; top: 0; z-index: 20;
    background: rgba(246,246,251,.9); backdrop-filter: blur(8px);
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px calc(14px); margin: 0 -16px 12px;
    border-bottom: 1px solid var(--line);
}
.aok-app-top .aok-app-logo { font-weight: 800; font-size: 17px; letter-spacing: -.02em; flex: 1; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.aok-app-top .aok-app-logo-dot { width: 24px; height: 24px; border-radius: 7px; background: var(--p); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: 0 0 auto; }
.aok-app-top .aok-chip { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--p050); color: var(--p600); }
.aok-app-top .aok-chip--live { background: var(--err-bg); color: var(--err); }

.aok-back { background: none; border: none; color: var(--p); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; }

/* Menu in alto */
.aok-menu-btn { background: none; border: none; font-size: 24px; line-height: 1; color: var(--ink); cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.aok-menu-btn:active { background: rgba(0,0,0,.05); }
.aok-menu { position: absolute; top: calc(100% - 4px); right: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 36px rgba(16,24,40,.18); padding: 6px; min-width: 210px; z-index: 60; }
.aok-menu[hidden] { display: none; }
.aok-menu-user { font-size: 12px; color: var(--muted); padding: 9px 12px 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.aok-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; font-family: inherit; font-size: 15px; color: var(--ink); padding: 12px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.aok-menu-item:hover, .aok-menu-item:active { background: var(--p050); }

/* Regola fissa: testo SEMPRE chiaro sui pulsanti pieni indigo */
.aok-app-btn--primary, .aok-app-btn--primary:hover, .aok-app-btn--primary:focus { color: #fff; }

/* Gate / loading */
.aok-app-gate, .aok-app-loading {
    max-width: 420px; margin: 0 auto; min-height: 80vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 14px; padding: 24px;
}
.aok-app-logo { font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }

/* Card */
.aok-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.aok-card h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.aok-card p.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; line-height: 1.5; }

/* Fields */
.aok-f { margin-bottom: 14px; }
.aok-f:last-child { margin-bottom: 0; }
.aok-f label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.aok-f .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.aok-app input[type=text], .aok-app input[type=date], .aok-app input[type=number], .aok-app input[type=password], .aok-app input[type=email], .aok-app input[type=tel], .aok-app select {
    width: 100%; height: 50px; padding: 0 14px; font-size: 16px; /* 16px = no zoom iOS */
    border: 1.5px solid var(--line); border-radius: var(--rs); background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s; appearance: none;
}
.aok-app input.aok-err-field, .aok-app select.aok-err-field { border-color: var(--err); box-shadow: 0 0 0 3px rgba(180,35,24,.15); }
.aok-app select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.aok-app input:focus, .aok-app select:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.aok-app input.aok-ac-chosen {
    border-color: #bde3c8; background: #f4fdf7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2315803d' d='M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 10px; align-items: center; }

/* Buttons */
.aok-app-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 52px; padding: 0 20px; font-size: 16px; font-weight: 600; font-family: inherit;
    border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
    cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s; text-decoration: none;
}
.aok-app-btn:active { transform: scale(.98); }
.aok-app-btn--primary { background: var(--p); border-color: var(--p); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.3); }
.aok-app-btn--primary:disabled { opacity: .5; box-shadow: none; }
.aok-app-btn--ghost { background: transparent; }
.aok-app-btn--danger { background: #fff; color: var(--err); border-color: #f3d2cf; }
.aok-app-btn--danger:active { background: var(--err-bg); }
.aok-app-btn-row { display: flex; gap: 10px; }
.aok-app-btn-row .aok-app-btn { width: auto; flex: 1; }

/* Counter */
.aok-counter { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 8px 0; }
.aok-counter button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 24px; color: var(--p); cursor: pointer; }
.aok-counter .n { font-size: 32px; font-weight: 700; min-width: 44px; text-align: center; }

/* Sticky bottom bar */
.aok-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.aok-bottom .inner { max-width: 560px; margin: 0 auto; }

/* Scan dropzone */
.aok-scan {
    display: block; position: relative;
    border: 1.5px solid var(--line); border-radius: var(--r); background: var(--p050);
    padding: 34px 18px; text-align: center; cursor: pointer; transition: background .15s, box-shadow .15s;
}
.aok-scan:active { background: #e4e7ff; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.aok-scan .ico { font-size: 42px; }
.aok-scan .t { font-weight: 700; margin-top: 6px; }
.aok-scan .s { font-size: 13px; color: var(--muted); margin-top: 3px; }
.aok-scan input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.aok-scan.aok-scan--alt { width: 100%; font-family: inherit; color: var(--ink); appearance: none; -webkit-appearance: none; margin-top: 12px; background: #fff; padding: 22px 18px; }
.aok-scan.aok-scan--alt:active { background: #f6f6fb; }
.aok-scan--alt .ico { font-size: 32px; }

/* Guest list / review */
.aok-glist { list-style: none; margin: 0; padding: 0; }
.aok-gitem { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--rs); margin-bottom: 10px; }
.aok-gitem .av { width: 38px; height: 38px; border-radius: 50%; background: var(--p050); color: var(--p600); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.aok-gitem .info { flex: 1; min-width: 0; }
.aok-gitem .info .nm { font-weight: 600; }
.aok-gitem .info .dt { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aok-gitem .ed { color: var(--p); font-weight: 600; font-size: 13px; background: none; border: none; cursor: pointer; }
/* Verifica facciale */
.aok-selfie { margin: 14px auto; width: 100%; max-width: 320px; aspect-ratio: 4 / 3; background: #0e0c1a; border-radius: var(--rs); overflow: hidden; }
.aok-selfie video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.aok-face-badge { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.aok-face-badge--ok { background: #ecfdf3; color: #15803d; }
.aok-face-badge--err { background: #fef2f2; color: #b91c1c; }
.aok-face-badge--warn { background: #fff7ed; color: #9a3412; }
.aok-consent2 { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; color: var(--muted); line-height: 1.45; margin: 6px 0 12px; cursor: pointer; }
.aok-consent2 input { margin-top: 2px; flex-shrink: 0; }

/* Badges / banners */
.aok-banner { border-radius: var(--rs); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }
.aok-banner--ok  { background: var(--ok-bg);  color: var(--ok); }
.aok-banner--err { background: var(--err-bg); color: var(--err); }
.aok-banner--info{ background: var(--p050);  color: var(--p600); }
.aok-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.aok-badge--ok   { color: var(--ok);  background: var(--ok-bg); }
.aok-badge--err  { color: var(--err); background: var(--err-bg); }
.aok-badge--warn { color: #9a3412;   background: #fff7ed; border: 1px solid #fed7aa; }
.aok-step-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }

/* Spinner */
.aok-spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: aokspin .7s linear infinite; }
.aok-spin--dark { border-color: rgba(79,70,229,.25); border-top-color: var(--p); }
@keyframes aokspin { to { transform: rotate(360deg); } }
.aok-loading-full { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; color: var(--muted); }

/* Autocomplete dropdown (riuso markup di aok-autocomplete.js) */
.aok-ac-wrap { position: relative; }
.aok-ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16,24,40,.16); overflow: hidden; max-height: 260px; overflow-y: auto; }
.aok-ac-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 15px; cursor: pointer; border-bottom: 1px solid #f3f2f9; }
.aok-ac-item:last-child { border-bottom: none; }
.aok-ac-item:active { background: var(--p050); }
.aok-ac-tag { font-size: 11px; font-weight: 600; color: var(--muted); background: #f3f3f7; padding: 2px 9px; border-radius: 999px; }

.aok-disc { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: var(--rs); padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; }
.aok-disc ul { margin: 6px 0 0 16px; padding: 0; }

/* ── Self check-in: landing QR + PIN ───────────────────────── */
.aok-app-gate .sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.aok-self-greet { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: 10px 0 4px; }
.aok-self-pin { width: 100%; text-align: center; letter-spacing: 10px; font-size: 26px; font-weight: 700; color: var(--ink);
    padding: 14px 12px; border: 1.5px solid var(--line); border-radius: var(--rs); background: #fff; margin: 6px 0 12px; }
.aok-self-pin:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.aok-self-err { color: var(--err) !important; font-weight: 600; }
.aok-self-house { margin-top: 16px; font-size: 12px; color: var(--muted); opacity: .8; }

/* ── Dashboard: selettore proprietà + card azioni ──────────── */
.aok-prop-one { font-weight: 700; font-size: 16px; color: var(--ink); margin-top: 6px; }
.aok-cards { display: grid; gap: 12px; margin-bottom: 14px; }
.aok-actcard { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font-family: inherit;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer;
    box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: box-shadow .15s, transform .08s; }
.aok-actcard:active { transform: scale(.99); box-shadow: 0 0 0 4px rgba(79,70,229,.10); }
.aok-actcard .ico { font-size: 26px; flex: 0 0 auto; }
.aok-actcard .tx { flex: 1; display: flex; flex-direction: column; }
.aok-actcard .t { font-weight: 700; font-size: 16px; color: var(--ink); }
.aok-actcard .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.aok-actcard .ar { font-size: 24px; color: var(--muted); flex: 0 0 auto; }
.aok-pin-input { font-size: 22px !important; letter-spacing: 6px; text-align: center; }
.aok-pin-big { font-size: 38px; font-weight: 800; letter-spacing: 8px; color: var(--p); margin: 10px 0 6px; }
.aok-app textarea { width: 100%; padding: 12px 14px; font-size: 14px; border: 1.5px solid var(--line); border-radius: var(--rs); font-family: inherit; color: var(--ink); resize: vertical; }
.aok-app textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }

/* ── Polish coerente con la landing (round 1) ──────────────── */
.aok-app-btn--primary { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-color: transparent; box-shadow: 0 10px 24px rgba(79,70,229,.32); }
.aok-app-btn--primary:active { box-shadow: 0 6px 16px rgba(79,70,229,.3); }
.aok-card { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 30px rgba(27,23,54,.06); border-radius: 18px; }
.aok-actcard { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 28px rgba(27,23,54,.06); border-radius: 18px; }
.aok-actcard:active { transform: scale(.99); box-shadow: 0 0 0 4px rgba(79,70,229,.10); }
.aok-app-logo .aok-app-logo-dot, .aok-appbar-logo span { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.aok-app-top { background: linear-gradient(180deg, rgba(246,246,251,.96), rgba(246,246,251,.82)); }
.aok-pin-big { background: linear-gradient(90deg, #4f46e5, #7c3aed); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aok-self-greet { background: linear-gradient(90deg, #4f46e5, #7c3aed); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.aok-scan { background: linear-gradient(180deg, #f3f1ff, #eef2ff); }

/* ── Riepilogo: card-dati ospite (stile demo) ───────────────── */
.aok-gcards { display: grid; gap: 12px; }
.aok-gcard { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: #fff; box-shadow: 0 6px 18px rgba(27,23,54,.06); }
.aok-gcard-top { display: flex; align-items: center; gap: 10px; }
.aok-gcard-av { width: 40px; height: 40px; border-radius: 50%; background: var(--p050); color: var(--p600); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.aok-gcard-nm { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; }
.aok-gcard .ed { background: none; border: none; color: var(--p); font-weight: 600; font-size: 13px; cursor: pointer; flex: 0 0 auto; padding: 4px 0; }
.aok-gcard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin-top: 12px; }
.aok-gcard-fields > div { min-width: 0; display: flex; flex-direction: column; }
.aok-gcard-fields .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.aok-gcard-fields .v { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 5px; }
.aok-gcard-fields .v i { color: #15803d; font-style: normal; }

/* ── Accesso passwordless (email → codice) ──────────────────── */
.aok-login { max-width: 380px; margin: 0 auto; text-align: center; }
.aok-login-sub { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 6px 0 18px; }
.aok-login-hint { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.aok-login input { width: 100%; box-sizing: border-box; margin: 0 0 20px; text-align: center; font-size: 17px; }
.aok-login #aok-login-code { letter-spacing: 6px; font-weight: 700; }
.aok-login .aok-app-btn { width: 100%; margin: 4px 0; }
.aok-login .aok-app-btn--ghost { background: none; border: none; color: var(--p); box-shadow: none; }

/* ══ Guscio "gestionale" (Fase B) ══════════════════════════════ */
.aok-gx { min-height: 100vh; min-height: 100dvh; }
.aok-sb { display: none; }
.aok-main { min-width: 0; }
.aok-topbar { display: flex; align-items: center; gap: 10px; padding: calc(26px + env(safe-area-inset-top)) 18px 8px; }
.aok-tb-grow { flex: 1; }
.aok-page-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--ink); line-height: 1.1; }
.aok-hgreet { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 2px; }
.aok-fchips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.aok-fchip { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.aok-fchip.on { background: var(--p050); border-color: var(--p); color: var(--p); }
/* Icone Lucide inline: allineate al testo, colore ereditato dal contesto. */
.aok-lic { display: inline-block; vertical-align: -.18em; flex: 0 0 auto; }
.aok-actcard .ico .aok-lic, .aok-scan .ico .aok-lic, .aok-gitem .av .aok-lic { vertical-align: middle; }
.aok-actcard .ico, .aok-scan .ico, .aok-gitem .av { color: var(--p600); line-height: 0; }
/* Il tema WP forza un serif sugli heading: riportiamo tutti i titoli dell'app al font Nunito. */
.aok-app h1, .aok-app h2, .aok-app h3, .aok-app h4,
.aok-app .aok-page-title, .aok-app .aok-h1, .aok-app .aok-h2, .aok-app .aok-card-h { font-family: inherit !important; }
.aok-refresh { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--p050); border: none; color: var(--p600); font-size: 17px; line-height: 1; cursor: pointer; transition: background .15s, transform .3s; }
.aok-refresh:hover { background: #e3e0fb; }
.aok-refresh:active { transform: rotate(180deg); }
.aok-view { padding: 4px 16px calc(90px + env(safe-area-inset-bottom)); }
.aok-loading { padding: 40px 0; text-align: center; color: var(--muted); }
.aok-h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 2px; }

/* bottom nav (mobile) */
/* Barra menu a pillola galleggiante (stile WhatsApp) */
.aok-bnav { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; z-index: 40;
    background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid rgba(236,233,245,.9); border-radius: 30px; padding: 9px 6px;
    box-shadow: 0 18px 40px -14px rgba(27,23,54,.32), 0 2px 6px rgba(27,23,54,.06); }
.aok-bnav .aok-nav-i { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0; border-radius: 0; }
.aok-bnav .aok-nav-i .ic { display: flex; align-items: center; justify-content: center; width: 54px; height: 30px; border-radius: 16px; transition: background .2s ease, color .2s ease; }
.aok-bnav .aok-nav-i .ic svg { width: 24px; height: 24px; }
.aok-bnav .aok-nav-i .lb { transition: color .2s ease; }
.aok-bnav .aok-nav-i.on { color: var(--p); }
.aok-bnav .aok-nav-i.on .ic { background: var(--p050); color: var(--p); }

/* dashboard */
.aok-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.aok-switch-sel { border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; font-size: 14px; font-weight: 700; background: #fff; color: var(--ink); }
.aok-switch-one { font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; }
.aok-kg { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.aok-kbox { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; }
.aok-kbox .n { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.aok-kbox .n.ok { color: var(--ok); } .aok-kbox .n.err { color: var(--err); }
.aok-kbox .l { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-weight: 700; }
.aok-d2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.aok-dcol { display: flex; flex-direction: column; gap: 14px; }
.aok-card-h { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.aok-card-b { font-size: 14px; }
.aok-rowb { display: flex; align-items: center; justify-content: space-between; }
.aok-link { color: var(--p600); font-weight: 700; text-decoration: none; font-size: 12.5px; }
.aok-card-note { font-size: 12px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.aok-cons-n { font-size: 18px; font-weight: 800; }
.aok-empty2 { color: var(--muted); font-size: 13.5px; padding: 8px 0; }
.aok-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; } .aok-kv .k { color: var(--muted); font-weight: 700; }

/* mini-table invii/fatture */
.aok-tw { overflow-x: auto; margin: 0 -4px; }
.aok-mt { width: 100%; border-collapse: collapse; font-size: 13px; }
.aok-mt th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.aok-mt td { padding: 9px 8px; border-bottom: 1px solid #f2f0f9; font-variant-numeric: tabular-nums; }
.aok-mt tr:last-child td { border-bottom: 0; }
.aok-mt .prop { font-weight: 700; }
.aok-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.aok-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.aok-st.ok { color: var(--ok); } .aok-st.ok::before { background: var(--ok); }
.aok-st.err { color: var(--err); } .aok-st.err::before { background: var(--err); }
.aok-st.na { color: var(--muted); } .aok-st.na::before { background: #cfcbdd; }

/* fatture rows */
.aok-inv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f0f9; }
.aok-inv:last-child { border-bottom: 0; }
.aok-inv .m { font-weight: 700; font-size: 14px; } .aok-inv .sub2 { font-size: 11.5px; color: var(--muted); }
.aok-inv .r { display: flex; align-items: center; gap: 9px; } .aok-inv .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.aok-ipill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.aok-ipill.paid { background: var(--ok-bg); color: var(--ok); }
.aok-ipill.wait { background: #fff4e0; color: #9a5b00; }
.aok-ipill.late { background: var(--err-bg); color: var(--err); }
.aok-ipill.neu { background: #f1f0f5; color: #6b7280; }

/* ── Desktop: sidebar persistente ── */
@media (min-width: 860px) {
    .aok-app-shell { max-width: 620px; } /* i wizard restano centrati */
    .aok-gx { display: grid; grid-template-columns: 236px 1fr; }
    .aok-sb { display: flex; flex-direction: column; background: #fbfaff; border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
    .aok-sb-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; padding: 6px 8px 14px; }
    .aok-nav { display: flex; flex-direction: column; gap: 1px; }
    .aok-nav-i { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
    .aok-nav-i .ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
    .aok-nav .aok-nav-i .ic svg { width: 18px; height: 18px; }
    .aok-nav-i:hover { background: #f1eefb; color: var(--ink); }
    .aok-nav-i.on { background: var(--p050); color: var(--p600); }
    .aok-nav-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #9a97ad; font-weight: 800; padding: 14px 11px 6px; }
    .aok-sb-sp { flex: 1; }
    .aok-sb-user { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 10px 8px 2px; margin-top: 8px; }
    .aok-sb-user .av { width: 30px; height: 30px; border-radius: 50%; background: var(--p050); color: var(--p600); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
    .aok-sb-user .tx { display: flex; flex-direction: column; line-height: 1.2; } .aok-sb-user .tx b { font-size: 13px; } .aok-sb-user .tx a { font-size: 11px; color: var(--muted); text-decoration: none; }
    .aok-bnav { display: none; }
    .aok-view { padding: 8px 26px 40px; max-width: 1040px; }
    .aok-kg { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .aok-d2 { grid-template-columns: 1.5fr 1fr; align-items: start; }
    .aok-topbar { padding: 14px 26px 0; }
}
