/* Swimphony Demo · design tokens */
:root {
  --swim-navy:        #2C3E50;
  --swim-navy-deep:   #1F2D3A;
  --swim-slate:       #5E7F96;
  --swim-slate-light: #89A3B5;
  --swim-blue:        #4A90D0;
  --swim-blue-deep:   #3A78B3;
  --swim-blue-light:  #D6E7F5;
  --swim-logo-dark:   #2C4858;
  --swim-logo-mid:    #3D718D;
  --swim-logo-light:  #6FA5C2;

  --ok:        #4CAF7D;
  --ok-soft:   #D9EFE2;
  --warn:      #F5A623;
  --warn-soft: #FCE6C2;
  --danger:    #E05D5D;
  --danger-soft:#F7D9D9;
  --heatmap:   #FF8A4C;
  --violet:    #7E57C2;

  --bg:       #F4F6F8;
  --bg-soft:  #FAFBFC;
  --surface:  #FFFFFF;
  --border:   #E4E9ED;
  --border-soft:#EDF1F4;
  --text:     #2C3E50;
  --muted:    #6B7C8C;
  --subtle:   #9AA8B4;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(44,62,80,.06);
  --shadow-md: 0 4px 14px rgba(44,62,80,.08);
  --shadow-lg: 0 18px 48px -12px rgba(44,62,80,.22);
  --shadow-xl: 0 28px 70px -20px rgba(44,62,80,.35);

  --t-display: clamp(32px, 4.2vw, 56px);
  --t-h1:  28px;
  --t-h2:  22px;
  --t-h3:  17px;
  --t-body:15px;
  --t-small:13px;
  --t-micro:11px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--t-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
a { color: var(--swim-blue); text-decoration: none; }
a:hover { color: var(--swim-blue-deep); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--text); }
img { max-width: 100%; }

h1 { font-size: var(--t-h1); margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: var(--t-h2); margin: 0 0 10px; letter-spacing: -0.005em; }
h3 { font-size: var(--t-h3); margin: 0 0 8px; }

.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: 10px 18px; border: 0;
  border-radius: var(--radius-pill);
  background: var(--swim-blue); color: #fff;
  font-weight: 600; font-size: var(--t-body);
  letter-spacing: .01em;
  transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.btn:hover { background: var(--swim-blue-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-cta {
  text-transform: uppercase; letter-spacing: .08em; padding: 14px 22px;
  background: var(--swim-navy); font-size: 14px;
}
.btn-cta:hover { background: var(--swim-navy-deep); }

.btn-ghost {
  background: transparent; color: var(--swim-navy); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--radius); }

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--swim-blue-light); color: var(--swim-navy);
  font-size: var(--t-small); font-weight: 600; line-height: 1;
}
.chip.ok    { background: var(--ok-soft); color: #246B4A; }
.chip.warn  { background: var(--warn-soft); color: #8B5A10; }
.chip.danger{ background: var(--danger-soft); color: #8A2929; }
.chip.neutral{ background: #ECEFF2; color: #586A7A; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label { color: var(--muted); font-size: var(--t-small); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .trend { color: var(--ok); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat-card .trend.down { color: var(--danger); }
.stat-card .spark { position: absolute; right: 14px; bottom: 14px; opacity: .8; pointer-events: none; }

.table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr.selected { background: var(--swim-blue-light); }
.table tbody tr:last-child td { border-bottom: 0; }

.input, .select {
  display: block; width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--swim-blue);
  box-shadow: 0 0 0 3px rgba(74,144,208,.18);
}

.swim-toast {
  pointer-events: auto;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px; min-width: 300px;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 12px; align-items: center;
  transform: translateX(120%);
  transition: transform .4s var(--ease-spring);
}
.swim-toast.shown { transform: translateX(0); }
.swim-toast .icon { font-size: 22px; line-height: 1; }
.swim-toast .t { font-weight: 700; font-size: 13px; color: var(--swim-navy); }
.swim-toast .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.swim-toast.ok .icon { color: var(--ok); }

.pulse-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 0 rgba(76,175,125,.6);
  animation: pulseDot 2s var(--ease) infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,125,.6); }
  50%      { box-shadow: 0 0 0 9px rgba(76,175,125,0); }
}

.badge-drop {
  position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  display: grid; place-items: center;
}
.badge-drop .token {
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--swim-blue) 45%, var(--swim-blue-deep) 80%);
  box-shadow: 0 28px 70px -10px rgba(58,120,179,.6), inset 0 -4px 12px rgba(0,0,0,.15);
  display: grid; place-items: center; color: #fff; text-align: center;
  font-weight: 700; padding: 18px;
  animation: badgeDrop 3.2s var(--ease-spring);
}
@keyframes badgeDrop {
  0%   { transform: translateY(-60vh) scale(.6); opacity: 0; }
  18%  { transform: translateY(0) scale(1.05); opacity: 1; }
  24%  { transform: translateY(-18px) scale(.98); }
  32%  { transform: translateY(0) scale(1); }
  80%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-20px) scale(.9); opacity: 0; }
}

.scrollbar-clean { scrollbar-width: thin; scrollbar-color: #CBD3DB transparent; }
.scrollbar-clean::-webkit-scrollbar { width: 10px; height: 10px; }
.scrollbar-clean::-webkit-scrollbar-thumb { background: #CBD3DB; border-radius: 10px; }
.scrollbar-clean::-webkit-scrollbar-thumb:hover { background: var(--swim-slate-light); }

.skeleton {
  background: linear-gradient(90deg, #EDF1F4, #DCE3EA, #EDF1F4);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.ring {
  --p: 0; --size: 84px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: conic-gradient(var(--swim-blue) calc(var(--p) * 1%), var(--border) 0);
  display: grid; place-items: center;
  position: relative; flex-shrink: 0;
}
.ring::before {
  content: ''; position: absolute; inset: 6px;
  background: var(--surface); border-radius: 50%;
}
.ring > * { position: relative; z-index: 1; font-weight: 700; color: var(--swim-navy); font-size: 15px; }

.ink { color: var(--swim-blue); }

.hidden { display: none !important; }

/* print-safe focus ring */
:focus-visible { outline: 2px solid var(--swim-blue); outline-offset: 2px; border-radius: 4px; }
