/* v2 · Apple-style layer (Rino, 25-11-2026). Loaded after styles.css: frosted glass, soft depth, springy motion.
   Same class names; this file only overrides the look. */
:root {
  --page: #F5F5F7; --surface: rgba(255, 255, 255, .78); --line: rgba(14, 30, 54, .08); --line-strong: rgba(14, 30, 54, .16);
  --soft: rgba(14, 30, 54, .05); --muted: #6E7480; --ink: #0E1E36; --ink-2: #22385C;
  --success: #1E7350; --green: #34A574; --blue: #4F7DF5; --success-soft: rgba(52, 165, 116, .12);
  --accent-soft: rgba(255, 184, 0, .16); --danger-soft: rgba(214, 69, 60, .1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "IBM Plex Sans", "Segoe UI", sans-serif;
  --r-md: 16px; --r-lg: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sh-1: 0 1px 2px rgba(14, 30, 54, .04), 0 4px 16px rgba(14, 30, 54, .05);
  --sh-2: 0 2px 6px rgba(14, 30, 54, .06), 0 18px 40px rgba(14, 30, 54, .10);
  --shadow-pop: 0 30px 80px rgba(14, 30, 54, .22), 0 2px 8px rgba(14, 30, 54, .08);
  --glass: saturate(180%) blur(22px);
}
body { background: var(--page); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
body::before { content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background: radial-gradient(40vmax 40vmax at 12% 8%, rgba(52, 165, 116, .16), transparent 60%),
              radial-gradient(36vmax 36vmax at 92% 14%, rgba(79, 125, 245, .13), transparent 60%),
              radial-gradient(40vmax 40vmax at 70% 100%, rgba(255, 184, 0, .10), transparent 60%);
  animation: drift 30s var(--ease) infinite alternate; }
@keyframes drift { to { transform: translate3d(2vmax, -2vmax, 0) scale(1.05); } }
::selection { background: rgba(52, 165, 116, .25); }
:focus-visible { outline: 3px solid rgba(52, 165, 116, .55); outline-offset: 2px; }

/* glass sidebar */
.side { background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); border-right: 1px solid var(--line); }
.brand { letter-spacing: -.5px; }
.brand svg { filter: drop-shadow(0 4px 10px rgba(30, 115, 80, .35)); }
#nav a { font-weight: 600; transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
#nav a:hover { background: rgba(14, 30, 54, .06); transform: translateX(2px); }
#nav a[aria-current="page"] { background: linear-gradient(180deg, var(--ink-2), var(--ink)); box-shadow: 0 8px 20px rgba(14, 30, 54, .25), inset 0 1px 0 rgba(255, 255, 255, .15); }
#nav .count { background: #FF3B30; color: #fff; border-radius: 999px; font-weight: 700; }
.account { background: rgba(255, 255, 255, .7); border-color: var(--line); box-shadow: var(--sh-1); }
.avatar { background: linear-gradient(135deg, var(--ink-2), var(--ink)); box-shadow: 0 4px 10px rgba(14, 30, 54, .25); }
.feed li.portal .avatar { background: linear-gradient(135deg, var(--green), var(--success)); }

/* type */
.h1 { font-size: 34px; line-height: 40px; letter-spacing: -.8px; }
.h2 { letter-spacing: -.3px; }
.big { font-size: 38px; letter-spacing: -1.2px; background: linear-gradient(180deg, var(--ink-2), var(--ink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big.bad { background: linear-gradient(180deg, #FF6B5E, #C8302A); -webkit-background-clip: text; background-clip: text; }
.big .of { -webkit-text-fill-color: var(--muted); }
.eyebrow { color: var(--success); }

/* cards: white glass, soft depth, lift + a spotlight that follows the pointer (--mx/--my set in app.ts) */
.card, .tile, .stat, .conn, .table-wrap {
  background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgba(52, 165, 116, .09), transparent 45%), var(--surface);
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, .9); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.tile:hover, .conn:hover, button.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, .9); }
.link-tile:hover { border-color: rgba(255, 255, 255, .7); }
button.stat { border-top: 0; position: relative; overflow: hidden; }
button.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--green), var(--blue)); }
button.stat[aria-pressed="true"] { background: linear-gradient(180deg, var(--ink-2), var(--ink)); color: #fff; box-shadow: 0 12px 28px rgba(14, 30, 54, .3); }
.empty { background: rgba(255, 255, 255, .5); border-color: var(--line-strong); }
.callout { border-radius: 14px; }

/* buttons: glossy, pressable */
.btn { border-radius: 12px; font-weight: 600; transition: transform .2s var(--spring), box-shadow .25s var(--ease), background .2s; }
.btn:hover { filter: none; }
.btn:active { transform: scale(.96); }
.btn.p { background: linear-gradient(180deg, #2A4572, var(--ink)); box-shadow: 0 6px 16px rgba(14, 30, 54, .28), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.p:hover { box-shadow: 0 10px 24px rgba(14, 30, 54, .34), inset 0 1px 0 rgba(255, 255, 255, .22); transform: translateY(-1px); }
.btn.o, .btn.g, .btn.d { background: rgba(255, 255, 255, .85); }
.btn.o:hover, .btn.g:hover, .btn.d:hover { background: #fff; transform: translateY(-1px); }
.btn[aria-pressed="true"] { background: linear-gradient(180deg, var(--ink-2), var(--ink)); }
.chip { border-radius: 999px; font-weight: 600; }

/* segmented control like iOS */
.seg { border: 0; background: rgba(14, 30, 54, .06); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { background: transparent; border-radius: 9px; transition: background .25s var(--ease), box-shadow .25s var(--ease); }
.seg button + button { border-left: 0; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(14, 30, 54, .12); }

/* inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line-strong); border-radius: 12px; transition: border-color .2s, box-shadow .2s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(52, 165, 116, .18); }
input[type="checkbox"], input[type="radio"], .goal-edit input[type=range] { accent-color: var(--success); }

/* tables */
thead th { background: rgba(255, 255, 255, .6); }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(52, 165, 116, .06); }
tbody tr.selected { background: rgba(52, 165, 116, .1); }

/* bars fill in */
.goal .bar, .hbars .hb { background: rgba(14, 30, 54, .07); border: 0; border-radius: 999px; }
.goal .bar i, .hbars .hb i { border-radius: 999px; background: linear-gradient(90deg, var(--ink-2), var(--blue)); }
.goal .bar i.met { background: linear-gradient(90deg, var(--success), var(--green)); }
main.enter .goal .bar i, main.enter .hbars .hb i { animation: grow 1s var(--ease) .2s both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* dialogs + toast: glass, scale in */
dialog.dlg { background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); border: 1px solid rgba(255, 255, 255, .8); border-radius: 24px; }
dialog.dlg[open] { animation: pop .35s var(--spring); }
dialog.dlg::backdrop { background: rgba(14, 30, 54, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg-foot { background: rgba(245, 245, 247, .85); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.toast { background: rgba(14, 30, 54, .88); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); border-radius: 999px; padding: 12px 22px;
  transform: translate(-50%, 20px); transition: opacity .3s var(--ease), transform .45s var(--spring); }
.toast.show { transform: translate(-50%, 0); }

/* page enter: blocks rise in one after another (class set in app.ts on a route change) */
main.enter > * { animation: rise .55s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .05s; }
main.enter > *:nth-child(3) { animation-delay: .1s; }
main.enter > *:nth-child(4) { animation-delay: .15s; }
main.enter > *:nth-child(n+5) { animation-delay: .2s; }
main.enter .kpis > *, main.enter .stats > * { animation: rise .6s var(--ease) both; }
main.enter .kpis > *:nth-child(2), main.enter .stats > *:nth-child(2) { animation-delay: .08s; }
main.enter .kpis > *:nth-child(3), main.enter .stats > *:nth-child(3) { animation-delay: .16s; }
main.enter .kpis > *:nth-child(4), main.enter .stats > *:nth-child(4) { animation-delay: .24s; }
main.enter .stats > *:nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* hover details (25-11-2026): small reactions, nothing that moves the layout */
.brand svg circle:last-child { transform-origin: 36px 12px; transition: transform .4s var(--spring); }
.brand:hover svg circle:last-child { transform: scale(1.25); }
#nav a .ico { transition: transform .35s var(--spring); }
#nav a:hover .ico { transform: scale(1.18) rotate(-6deg); }
.tile .lbl, .stat span { transition: color .25s var(--ease); }
.tile:hover .lbl, button.stat:hover span { color: var(--success); }
.tile .big, .stat strong { display: inline-block; transition: transform .35s var(--spring); transform-origin: left bottom; }
.tile:hover .big, button.stat:hover strong { transform: scale(1.04); }
.link-tile .muted { transition: transform .3s var(--ease), color .25s; }
.link-tile:hover .muted { transform: translateX(6px); color: var(--success); }
.btn.p { position: relative; overflow: hidden; }
.btn.p::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease); pointer-events: none; }
.btn.p:hover::after { transform: translateX(120%); }
.chip { transition: transform .25s var(--spring), box-shadow .25s; }
tr:hover .chip, .chip:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(14, 30, 54, .1); }
tbody tr { box-shadow: inset 0 0 0 transparent; transition: background .2s, box-shadow .25s var(--ease); }
tbody tr:hover { box-shadow: inset 3px 0 0 var(--green); }
tbody tr:hover .client-name { color: var(--success); }
.avatar { transition: transform .3s var(--spring), box-shadow .3s; }
.acct:hover .avatar, li:hover > .avatar, .person:hover .avatar { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(52, 165, 116, .25), 0 4px 10px rgba(14, 30, 54, .25); }
.feed li, .risk li, .tasks li { transition: transform .25s var(--ease), background .25s; border-radius: 12px; }
.feed li:hover, .risk li:hover, .tasks li:hover { transform: translateX(4px); background: rgba(52, 165, 116, .05); }
.chart .bar-g path { transition: fill .2s, opacity .2s; }
.chart .bar-g:hover path { fill: var(--green); opacity: 1; }
.conn .logo { transition: transform .4s var(--spring); }
.conn:hover .logo { transform: rotate(-8deg) scale(1.08); }
.acct-out { transition: background .2s, color .2s, transform .3s var(--spring); }
.acct-out:hover { transform: translateX(2px); }
.drop { transition: border-color .2s, background .2s, transform .3s var(--spring); }
.drop:hover { transform: scale(1.01); }

@media (max-width: 1100px) { .side { position: sticky; top: 0; z-index: 5; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
