/* RistoRush OS — reset, sfondo e guscio dell'app (rail, topbar, isola, pagina). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* wallpaper: macchie di colore dietro al vetro */
.wall {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 8% 0%, var(--wall-a), transparent 70%),
    radial-gradient(40vw 40vh at 100% 10%, var(--wall-b), transparent 70%),
    radial-gradient(70vw 60vh at 70% 110%, var(--wall-c), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
.wall::after { /* grana leggera */
  content: ""; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* layout */
.app { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: calc(var(--rail-w) + 24px) 1fr; }
.main { position: relative; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.page { padding: 84px 28px 48px 8px; max-width: 1480px; animation: pageIn .45s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* rail laterale (icone) */
.rail, .rail.glass {
  position: fixed; top: 14px; bottom: 14px; left: 12px; width: var(--rail-w); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0;
  border-radius: 32px;
}
.rail-logo { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 10px;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.03)); border: 1px solid var(--glass-line-2);
  box-shadow: 0 6px 20px -6px rgba(19,99,48,.8); }
.rail-logo img { width: 24px; height: auto; }
.rail-item {
  position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-3); transition: background .2s var(--ease), color .2s, transform .2s var(--spring);
}
.rail-item:hover { color: var(--ink); background: var(--glass-hover); }
.rail-item:active { transform: scale(.92); }
.rail-item.active { color: var(--ink); background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 4px 14px -4px rgba(0,0,0,.6); }
.rail-item .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 0 2px var(--bg); }
.rail-sep { width: 22px; height: 1px; background: var(--glass-line); margin: 6px 0; }
.rail-spacer { flex: 1; }
.rail-item[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 54px; white-space: nowrap; padding: 6px 10px; border-radius: 10px;
  font-size: var(--fs-sm); color: var(--ink); background: var(--glass-strong); border: 1px solid var(--glass-line);
  backdrop-filter: blur(20px); pointer-events: none; animation: pageIn .2s var(--ease);
}

/* topbar */
.topbar { position: fixed; top: 14px; right: 28px; left: calc(var(--rail-w) + 32px); z-index: 15; height: 52px;
  display: flex; align-items: center; justify-content: flex-end; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.top-actions { display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: var(--r-pill); }
.top-actions .icon-btn { width: 40px; height: 40px; }

/* isola dinamica */
.island-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 30; }
.island {
  display: flex; align-items: center; gap: 10px; min-width: 132px; height: 38px; padding: 0 8px 0 10px;
  border-radius: var(--r-pill); background: #050605; color: var(--ink); font-size: var(--fs-sm); font-weight: 500;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: min-width .5s var(--spring), height .5s var(--spring), padding .4s var(--spring);
  overflow: hidden; white-space: nowrap;
}
.island.idle { min-width: 120px; justify-content: center; color: var(--ink-3); }
.island.expanded { min-width: 330px; }
.island .i-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.island .i-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.island .i-time { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; }
.island .i-act { padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.09); color: var(--ink-2); font-size: var(--fs-xs); }
.island .i-act:hover { background: rgba(255,255,255,.16); color: var(--ink); }
.island-in > * { animation: islandIn .35s var(--ease) both; }
@keyframes islandIn { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }

/* intestazione pagina */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.025em; margin: 0; line-height: 1.1; }
.page-sub { color: var(--ink-3); margin-top: 6px; font-size: var(--fs); }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* griglie */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.mt { margin-top: var(--gap); }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .rail { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; height: 62px; flex-direction: row; justify-content: space-around; padding: 0 8px; overflow-x: auto; }
  .rail-logo, .rail-sep, .rail-spacer, .rail-item.r-opt { display: none; }
  .topbar { left: 16px; right: 16px; }
  .page { padding: 76px 16px 96px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .island.expanded { min-width: 240px; }
  .island-wrap { left: 16px; transform: none; }
}

/* pagina di accesso */
.gate { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { width: min(420px, 100%); padding: 36px 32px 32px; text-align: center; animation: pageIn .5s var(--ease); }
.gate-logo { width: 180px; height: auto; margin: 0 auto 18px; display: block; }
.gate-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.gate-sub { color: var(--ink-3); margin: 8px 0 24px; line-height: 1.5; }
.gate-btn { width: 100%; justify-content: center; height: 44px; font-size: var(--fs); }
