/* Nodo J — Dashboard UI kit styles. A generic SaaS web-app shell built on the
   foundation tokens: sidebar, topbar, stat cards, chart, data table, drawer, modal. */
@import url('./foundations.css');

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); color: var(--fg1); background: var(--bg);
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side { background: var(--slate-950); color: var(--slate-400); display: flex; flex-direction: column;
  padding: 18px 14px; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.03em; color: #fff; }
.side-logo .j { color: var(--accent); }
.side-sec { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--slate-600); padding: 16px 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 500; color: var(--slate-300); cursor: pointer; transition: all var(--dur-fast) var(--ease); }
.nav-item svg { width: 18px; height: 18px; color: var(--slate-500); transition: color var(--dur-fast); }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item:hover svg { color: var(--slate-300); }
.nav-item.active { background: rgba(0,202,170,.12); color: #fff; }
.nav-item.active svg { color: var(--accent); }
.nav-item .badge-n { margin-left: auto; font-family: var(--font-mono); font-size: 11px; background: rgba(255,255,255,.08);
  color: var(--slate-300); padding: 1px 7px; border-radius: 999px; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px;
  border-top: 1px solid var(--line-ink); margin-top: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #053b31;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

/* ---------- main / topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: rgba(255,255,255,.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 14px; color: var(--fg3); } .crumb b { color: var(--fg1); font-weight: 600; }
.search { margin-left: 8px; flex: 1; max-width: 360px; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--fg3); }
.search input { width: 100%; font-family: var(--font-sans); font-size: 14px; padding: 9px 12px 9px 34px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); outline: none; transition: all var(--dur-fast); }
.search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: all var(--dur-fast); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; color: var(--fg2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }

/* ---------- buttons / badges (shared) ---------- */
.btn { font-family: var(--font-sans); font-weight: 600; font-size: 14px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent;
  cursor: pointer; transition: all var(--dur) var(--ease); white-space: nowrap; line-height: 1; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #053b31; }
.btn-primary:hover { background: var(--accent-600); }
.btn-secondary { background: var(--surface); color: var(--fg1); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--slate-400); }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; line-height: 1.3; }
.badge .d { width: 6px; height: 6px; border-radius: 50%; }
.b-green { background: var(--success-bg); color: #0c5a2c; } .b-green .d { background: var(--success); }
.b-amber { background: var(--warning-bg); color: #8a4d05; } .b-amber .d { background: var(--warning); }
.b-teal  { background: var(--accent-50); color: var(--accent-ink); } .b-teal .d { background: var(--accent); }
.b-gray  { background: var(--slate-100); color: var(--slate-600); } .b-gray .d { background: var(--slate-400); }

/* ---------- content ---------- */
.content { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: -.02em; margin: 0; }
.page-head p { font-size: 14.5px; color: var(--fg2); margin: 6px 0 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.stat .lbl { font-size: 13px; color: var(--fg2); display: flex; align-items: center; gap: 7px; }
.stat .lbl svg { width: 15px; height: 15px; color: var(--accent-ink); }
.stat .val { font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -.02em; margin-top: 10px; }
.stat .chg { font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.chg.up { color: var(--success); } .chg.down { color: var(--danger); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin: 0; }
.panel-head .sub { font-size: 12.5px; color: var(--fg3); }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }

/* chart */
.chart { padding: 18px; display: flex; align-items: flex-end; gap: 12px; height: 220px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 60%; max-width: 30px; border-radius: 5px 5px 0 0; background: var(--accent-200); transition: height var(--dur-slow) var(--ease); }
.bar.hl { background: var(--accent); }
.bar-col .x { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); }

/* activity list */
.act { padding: 8px 18px 14px; }
.act-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: none; }
.act-ic { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--accent-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-ic svg { width: 16px; height: 16px; color: var(--accent-ink); }
.act-row .t { font-size: 13.5px; color: var(--fg1); } .act-row .t b { font-weight: 600; }
.act-row .time { font-size: 12px; color: var(--fg3); margin-top: 2px; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg3); font-weight: 500; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--slate-50); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr { cursor: pointer; transition: background var(--dur-fast); }
.table tbody tr:hover { background: var(--slate-50); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-name { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.proj-ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: #fff; }
.muted { color: var(--fg3); font-family: var(--font-mono); font-size: 13px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(12,15,20,.4); backdrop-filter: blur(2px); z-index: 60; animation: fade var(--dur) var(--ease); }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw; background: var(--surface);
  box-shadow: var(--shadow-xl); z-index: 70; display: flex; flex-direction: column; animation: slidein var(--dur-slow) var(--ease-out); }
.drawer-head { padding: 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.drawer-body { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .k { color: var(--fg2); } .kv .v { font-weight: 600; }
.close-x { background: var(--surface-2); border: none; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.close-x svg { width: 18px; height: 18px; color: var(--fg2); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(12,15,20,.5); backdrop-filter: blur(3px); animation: fade var(--dur) var(--ease); }
.modal-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); width: 100%; max-width: 440px; padding: 26px; animation: pop var(--dur-slow) var(--ease-out); }
.modal-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0 0 18px; letter-spacing: -.02em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--fg2); }
.field input, .field select { font-family: var(--font-sans); font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); outline: none; background: var(--surface); transition: all var(--dur-fast); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: var(--ring); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--slate-950); color: #fff;
  padding: 12px 18px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px; z-index: 90; animation: pop var(--dur-slow) var(--ease-out); }
.toast svg { width: 17px; height: 17px; color: var(--accent); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } }
