:root {
  --bg: #07080d;
  --bg-2: #0c0f18;
  --panel: #111522;
  --panel-2: #161b2c;
  --line: #222a40;
  --text: #e7ecf5;
  --muted: #8d97ad;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #d946ef;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.2em; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: 600 .95rem var(--font);
  cursor: pointer; transition: .15s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: var(--cyan); }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 20px rgba(139, 92, 246, .35); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .45em .8em; font-size: .85rem; }
.btn-danger { border-color: rgba(248,113,113,.4); color: var(--red); background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .35em; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: .7em .85em; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: rgba(7, 8, 13, .8); border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 800; letter-spacing: .02em; text-decoration: none !important; }
.brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(139,92,246,.4)); }
.brand small { display: block; font: 500 .7rem var(--mono); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a:not(.btn) { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
@media (max-width: 760px) { .nav .nav-link { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 96px 0 80px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(139,92,246,.25), transparent 70%),
    radial-gradient(700px 360px at 85% 30%, rgba(34,211,238,.18), transparent 70%),
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0/40px 40px;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.eyebrow { font: 600 .78rem var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1rem; display: inline-block; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.hero-logo { position: relative; justify-self: center; }
.hero-logo img { width: min(360px, 70vw); filter: drop-shadow(0 0 40px rgba(139,92,246,.45)) drop-shadow(0 0 20px rgba(34,211,238,.25)); }
.tagline { margin-top: 1.5rem; font: 600 .8rem var(--mono); letter-spacing: .2em; color: var(--magenta); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; text-align: center; } .hero p.lead { margin-inline: auto; } .hero-actions { justify-content: center; } .hero { padding-top: 56px; } }

/* Sections */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.feature .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(34,211,238,.1); color: var(--cyan); margin-bottom: .9rem; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }

/* Product grid */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .4em .85em; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: .85rem; cursor: pointer; font-weight: 500;
}
.chip.active, .chip:hover { color: #fff; border-color: var(--violet); background: rgba(139,92,246,.15); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.product {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: .2s; display: flex; flex-direction: column;
}
.product:hover { transform: translateY(-3px); border-color: rgba(139,92,246,.6); box-shadow: var(--shadow); }
.product .thumb { aspect-ratio: 1; background: #000; overflow: hidden; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product .meta { padding: .85rem 1rem 1rem; }
.product h4 { font-size: .95rem; margin: 0 0 .25rem; }
.product .cat { font: 500 .72rem var(--mono); color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.product .count { font-size: .8rem; color: var(--muted); margin-top: .35rem; }

/* Share bar & footer */
.share { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.share a, .share button { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.share svg { width: 18px; height: 18px; fill: currentColor; }
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }

/* Auth page */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; }
.auth-wrap::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(600px 400px at 30% 20%, rgba(139,92,246,.22), transparent 70%), radial-gradient(600px 400px at 70% 80%, rgba(34,211,238,.15), transparent 70%); }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; margin-bottom: 1.5rem; }
.auth-card .brand img { width: 72px; height: 72px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 1.4rem; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: .6em; border-radius: 7px; font: 600 .9rem var(--font); cursor: pointer; }
.tabs button.active { background: var(--panel-2); color: var(--text); }
.msg { padding: .7em .9em; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }
.msg.err { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.msg.ok { background: rgba(52,211,153,.1); color: var(--green); border: 1px solid rgba(52,211,153,.3); }

/* Portal layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); padding: 1.2rem; display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: .3rem .4rem 1rem; border-bottom: 1px solid var(--line); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--muted); padding: .65rem .8rem; border-radius: 9px; font: 500 .93rem var(--font); cursor: pointer;
}
.side-nav button svg { width: 18px; height: 18px; flex: none; }
.side-nav button:hover { background: var(--panel); color: var(--text); }
.side-nav button.active { background: rgba(139,92,246,.15); color: #fff; box-shadow: inset 3px 0 0 var(--violet); }
.side-nav .label { font: 600 .68rem var(--mono); color: var(--muted); letter-spacing: .15em; text-transform: uppercase; padding: .9rem .8rem .3rem; opacity: .7; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: .75rem; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: var(--grad); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; border: 2px solid var(--panel); }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.main { padding: 1.6rem 2rem 3rem; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topbar h1 { font-size: 1.6rem; margin: 0; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 100; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: inline-flex; }
  .main { padding: 1rem 16px 3rem; }
}

/* Cards / stats */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.card h3 { font-size: 1.05rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat .n { font-size: 2rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* Projects */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 180px; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; gap: .8rem; cursor: pointer; transition: .15s; }
.pcard:hover { border-color: rgba(34,211,238,.5); }
.pcard .top { display: flex; gap: .8rem; align-items: center; }
.pcard .top img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #000; flex: none; }
.pcard h4 { margin: 0; font-size: 1rem; }
.pcard .sub { font-size: .8rem; color: var(--muted); }
.pcard p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.progress { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); border-radius: 99px; }
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .2em .6em; border-radius: 999px; font: 600 .72rem var(--font); border: 1px solid; white-space: nowrap; }
.s-todo { color: var(--muted); border-color: var(--line); }
.s-in_progress { color: var(--cyan); border-color: rgba(34,211,238,.35); background: rgba(34,211,238,.08); }
.s-review { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.s-blocked { color: var(--red); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.s-done { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.p-high { color: var(--magenta); border-color: rgba(217,70,239,.35); }
.p-medium { color: var(--violet); border-color: rgba(139,92,246,.35); }
.p-low { color: var(--muted); border-color: var(--line); }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .item small { color: var(--muted); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-2); color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
td select { width: auto; padding: .35em .5em; font-size: .85rem; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal-box { width: min(620px, 100%); max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.2rem; }
.modal-head h2 { font-size: 1.3rem; margin: 0; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.checklist { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem; background: var(--bg-2); }
.checklist label { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; margin: 0; color: var(--text); border-radius: 6px; cursor: pointer; }
.checklist label:hover { background: var(--panel); }
.checklist input { width: auto; }
.notes { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.note { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
.note .h { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-bottom: .25rem; }

.card-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.card-actions:empty { display: none; }
a.product { color: var(--text); text-decoration: none !important; }
.product .desc { color: var(--muted); font-size: .82rem; margin: .3rem 0 0; }

/* Training Center directory */
.tgroup { margin-bottom: 2rem; }
.tgroup h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; margin-bottom: .9rem; }
.tlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.tlink {
  display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: .15s;
}
.tlink:hover { text-decoration: none; border-color: var(--cyan); transform: translateY(-2px); }
.tlink b { font-size: .95rem; }
.tlink span { color: var(--muted); font-size: .86rem; flex: 1; }
.tlink small { color: var(--cyan); font-size: .75rem; word-break: break-all; }
.pillars { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.pillars span { padding: .4em .9em; border-radius: 999px; background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.3); font-size: .85rem; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: .8rem 1.2rem; border-radius: 10px; z-index: 300; box-shadow: var(--shadow); font-size: .92rem; }
.loader { display: grid; place-items: center; min-height: 100vh; }
.spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
