@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f6ff;
  --bg-secondary: #ecf0ff;
  --panel: rgba(255,255,255,0.65);
  --panel-strong: rgba(255,255,255,0.9);
  --panel-outline: rgba(39,72,169,0.08);
  --text: #0b1220;
  --muted: #5f6b7a;
  --muted-strong: #1f2a44;
  --primary: #5163ff;
  --primary-dark: #2734f5;
  --accent: #18b4ff;
  --accent-soft: rgba(81,99,255,0.14);
  --danger: #f87171;
  --warning: #fbbf24;
  --success: #34d399;
  --shadow-lg: 0 28px 80px rgba(15,34,76,0.18);
  --shadow-md: 0 18px 40px rgba(15,34,76,0.12);
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.55 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 720px at 12% 12%, rgba(81,99,255,0.20) 0%, rgba(81,99,255,0) 63%),
    radial-gradient(1000px 700px at 88% 8%, rgba(24,180,255,0.22) 0%, rgba(24,180,255,0) 60%),
    linear-gradient(180deg, #ffffff 0%, #eef2ff 55%, #f6f8ff 100%);
  background-attachment: fixed;
}

/* Landing */
.landing-wrap { display:grid; gap:64px; padding-bottom:80px; position:relative; }
.landing {
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(320px,1.1fr) minmax(320px,440px);
  gap:48px;
  align-items:center;
  padding:72px clamp(32px,7vw,108px);
}
.landing-hero { display:grid; gap:26px; position:relative; }
.landing-badge {
  display:inline-flex; align-items:center; gap:10px;
  padding:9px 22px; border-radius:999px;
  background:linear-gradient(135deg, rgba(81,99,255,0.18), rgba(24,180,255,0.18));
  color:var(--primary-dark); font-size:12px; font-weight:600;
  text-transform:uppercase; letter-spacing:0.18em;
}
.landing h1 { margin:0; font-size:clamp(38px,4.8vw,60px); line-height:1.04; letter-spacing:-0.02em; color:var(--muted-strong); }
.landing-lead { margin:0; max-width:680px; font-size:18px; color:var(--muted); }
.landing-highlights { margin:0; padding-left:22px; display:grid; gap:10px; color:var(--muted-strong); list-style:disc; }
.landing-highlights li { font-size:15px; }
.landing-stats { display:flex; flex-wrap:wrap; gap:20px; }
.stat {
  min-width:170px;
  background:var(--panel-strong);
  border-radius:24px;
  padding:22px 26px;
  border:1px solid var(--panel-outline);
  box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; gap:6px;
}
.stat-value { font-size:34px; font-weight:700; color:var(--primary-dark); letter-spacing:-0.02em; }
.stat-label { font-size:13px; color:var(--muted); text-transform:none; }

.landing-testimonials { margin-top:4px; }
.quote {
  font-size:16px; line-height:1.6;
  background:rgba(255,255,255,0.7);
  border-left:4px solid var(--primary);
  padding:22px 24px;
  border-radius:20px;
  color:var(--text);
  box-shadow:var(--shadow-md);
}
.quote-author { display:block; margin-top:12px; font-size:13px; color:var(--muted); font-weight:600; }

.landing-panel {
  padding:40px;
  display:grid; gap:28px;
  border:1px solid var(--panel-outline);
  border-radius:var(--radius-lg);
  background:rgba(255,255,255,0.94);
  box-shadow:var(--shadow-lg);
}
.landing-panel-header .brand { font-size:34px; }
.landing-form { display:grid; gap:20px; }
.landing-form .field { display:grid; gap:6px; }
.landing-form input, .landing-form select, .landing-form textarea {
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(81,99,255,0.2);
  background:rgba(255,255,255,0.9);
  font:inherit;
  transition:border .2s ease, box-shadow .2s ease;
}
.landing-form input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(81,99,255,0.18); outline:none; }

.landing-demo { border-top:1px solid rgba(39,72,169,0.1); padding-top:18px; display:grid; gap:14px; }
.landing-demo-header { display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:600; }
.demo-item { display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid rgba(39,72,169,0.08); }
.demo-item:last-child { border-bottom:none; }
.demo-item strong { font-size:14px; }
.demo-item .muted { font-size:12px; color:var(--muted); }
.landing-demo .pill { background:rgba(81,99,255,0.15); color:var(--primary-dark); border:none; }

label { font-weight:600; color:var(--muted-strong); font-size:13px; }
.field { display:grid; gap:6px; }
.two { display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
input, textarea, select { font:inherit; border-radius:12px; border:1px solid rgba(81,99,255,0.18); background:rgba(255,255,255,0.9); padding:11px 14px; transition:border .2s ease, box-shadow .2s ease; }
textarea { resize:vertical; min-height:120px; }
input:focus, textarea:focus, select:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(81,99,255,0.18); outline:none; }

.trust-logos { display:flex; flex-wrap:wrap; gap:12px; }
.trust-card { padding:12px 18px; border-radius:14px; background:rgba(255,255,255,0.7); border:1px solid var(--panel-outline); display:flex; flex-direction:column; gap:2px; font-size:12px; box-shadow:var(--shadow-md); }

.landing-sections { display:grid; gap:36px; padding:0 clamp(32px,7vw,108px); }
.feature-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:20px; }
.feature-card { padding:24px; border-radius:22px; border:1px solid var(--panel-outline); background:rgba(255,255,255,0.9); box-shadow:var(--shadow-md); display:grid; gap:12px; }
.feature-card h3 { margin:0; font-size:18px; color:var(--muted-strong); }
.feature-card p { margin:0; color:var(--muted); }
.feature-card ul { margin:0; padding-left:18px; color:var(--muted); font-size:13px; display:grid; gap:6px; }

.pack-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:20px; }
.pack-card { padding:24px; border-radius:22px; border:1px solid var(--panel-outline); background:#fff; box-shadow:var(--shadow-md); display:grid; gap:12px; }
.pack-card h4 { margin:0; font-size:17px; color:var(--muted-strong); }
.pack-card ul { margin:0; padding-left:18px; display:grid; gap:6px; color:var(--muted); font-size:13px; }

.landing-cta {
  margin:0 clamp(32px,7vw,108px);
  padding:38px 40px;
  border-radius:28px;
  border:1px solid rgba(81,99,255,0.16);
  background:linear-gradient(135deg, rgba(81,99,255,0.22), rgba(24,180,255,0.2));
  display:flex; flex-wrap:wrap; gap:20px; align-items:center; justify-content:space-between;
  box-shadow:var(--shadow-lg);
}
.landing-cta h2 { margin:0; font-size:28px; max-width:520px; color:var(--muted-strong); }
.landing-cta p { margin:6px 0 0; color:var(--muted); max-width:520px; }

/* Shell */
.glass { background:var(--panel); backdrop-filter:blur(18px); border:1px solid var(--panel-outline); border-radius:var(--radius-lg); box-shadow:var(--shadow-md); }
.glass.card { padding:24px; }
.layout {
  display:grid;
  grid-template-columns:260px 1fr;
  grid-template-rows:72px 1fr;
  grid-template-areas:"sidebar header" "sidebar main";
  height:100%;
}
.sidebar {
  grid-area:sidebar;
  padding:20px 18px;
  display:flex; flex-direction:column; gap:14px;
  border-right:1px solid rgba(33,52,126,0.08);
  background:linear-gradient(180deg, rgba(255,255,255,0.82), rgba(247,249,255,0.97));
}
.brand { display:flex; align-items:center; gap:12px; font-weight:700; font-size:18px; color:var(--muted-strong); letter-spacing:0.4px; }
.brand-logo-img { width:30px; height:30px; border-radius:10px; box-shadow:0 16px 40px rgba(81,99,255,0.28); }
.nav { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.nav a { color:var(--muted-strong); text-decoration:none; padding:12px 14px; border-radius:14px; display:flex; gap:12px; align-items:center; font-weight:500; transition:transform .2s ease, background .2s ease, color .2s ease; }
.nav a svg { opacity:.7; transition:opacity .2s ease; }
.nav a.active, .nav a:hover { background:var(--accent-soft); color:var(--primary-dark); transform:translateX(6px); }
.nav a.active svg, .nav a:hover svg { opacity:1; }

.header { grid-area:header; display:flex; align-items:center; justify-content:space-between; padding:16px 24px; border-bottom:1px solid rgba(33,52,126,0.08); backdrop-filter:blur(18px); }
.ticker { display:flex; gap:10px; align-items:center; white-space:nowrap; overflow:hidden; color:var(--muted); font-weight:500; }
.ticker .dot { width:8px; height:8px; border-radius:999px; background:var(--danger); animation:pulse 1.4s infinite; }

.main { grid-area:main; padding:28px clamp(28px,7vw,72px); overflow:auto; display:grid; gap:22px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:20px; }
.kpi { padding:24px 26px; }
.kpi h4 { margin:0 0 10px 0; font-size:12px; text-transform:uppercase; letter-spacing:0.6px; color:var(--muted); }
.kpi .num { font-size:32px; font-weight:700; letter-spacing:-0.02em; color:var(--muted-strong); }

.row { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; }
.list { display:flex; flex-direction:column; gap:14px; }
.list .item { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--muted-strong); }
.list .item + .item { border-top:1px dashed rgba(33,52,126,0.08); padding-top:12px; }

.progress { position:relative; height:8px; background:rgba(81,99,255,0.12); border-radius:999px; flex:1; overflow:hidden; }
.progress span { position:absolute; inset:0; width:var(--w,0%); background:linear-gradient(135deg, var(--primary), var(--accent)); border-radius:999px; }

.btn { background:var(--primary); border:none; color:#fff; padding:11px 20px; border-radius:12px; font-weight:600; cursor:pointer; box-shadow:0 14px 32px rgba(81,99,255,0.28); transition:transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform:translateY(-1px); box-shadow:0 18px 36px rgba(81,99,255,0.25); }
.btn.secondary { background:rgba(81,99,255,0.09); color:var(--primary-dark); border:1px solid rgba(81,99,255,0.24); box-shadow:none; }
.btn.secondary:hover { background:rgba(81,99,255,0.14); }

.pill { display:inline-flex; align-items:center; justify-content:center; padding:6px 14px; border-radius:999px; border:1px solid rgba(33,52,126,0.12); font-size:12px; font-weight:600; color:var(--muted-strong); background:rgba(255,255,255,0.85); }
.tag { display:inline-flex; align-items:center; padding:6px 10px; border-radius:10px; background:rgba(33,52,126,0.08); color:var(--muted-strong); font-weight:600; font-size:12px; }
.tag.yellow { background:rgba(251,191,36,0.16); color:#b45309; }
.tag.red { background:rgba(248,113,113,0.18); color:#b91c1c; }

.page-tabs { display:flex; gap:10px; flex-wrap:wrap; padding:6px; background:rgba(255,255,255,0.7); border-radius:18px; border:1px solid rgba(33,52,126,0.1); box-shadow:var(--shadow-md); position:sticky; top:0; z-index:5; backdrop-filter:blur(12px); }
.page-tab { border:none; background:transparent; padding:8px 16px; border-radius:12px; font-weight:600; color:var(--muted); cursor:pointer; transition:background .2s ease, color .2s ease; }
.page-tab--active, .page-tab:hover { background:rgba(81,99,255,0.12); color:var(--primary-dark); }

.dashboard-split { display:grid; gap:18px; }
.dashboard-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; }
.dashboard-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; }
.quick-links { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }

.filters-grid { display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); margin-top:16px; }
.goal-grid { display:grid; gap:18px; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
.goal-card__header { display:flex; justify-content:space-between; gap:16px; }
.goal-card__stats { display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.goal-card__actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.goal-detail { margin-top:14px; }
.inline-sub-form, .inline-plan-form { margin-top:12px; }

.risk-grid { display:grid; gap:18px; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); }
.risk-card__header { display:flex; justify-content:space-between; gap:16px; }
.risk-card__stats { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.risk-card__actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.risk-card__plans { margin-top:14px; display:grid; gap:10px; }
.risk-card__plans[hidden] { display:none; }
.risk-history { margin-top:12px; }

.org-summary { display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
.org-summary .summary-card { text-align:center; padding:18px; }
.org-summary .summary-label { font-size:12px; text-transform:uppercase; color:var(--muted); }
.org-summary .summary-value { font-size:26px; font-weight:700; }

.org-wrapper { display:grid; gap:18px; }

.tree { background:rgba(255,255,255,0.88); border-radius:20px; padding:10px; overflow:auto; box-shadow:var(--shadow-md); }
.tree ul { list-style:none; margin:0; padding-left:0; }
.tree ul ul { margin-left:24px; border-left:1px dashed rgba(33,52,126,0.12); padding-left:18px; }
.tree li { margin:12px 0; }
.tree .team { padding:14px 16px; border-radius:16px; border:1px solid rgba(81,99,255,0.14); background:rgba(255,255,255,0.92); display:grid; gap:6px; }

.feature-card, .pack-card, .glass.card { animation:fadeInUp .5s ease forwards; opacity:0; }
.feature-card:nth-child(1) { animation-delay:.05s; }
.feature-card:nth-child(2) { animation-delay:.1s; }
.feature-card:nth-child(3) { animation-delay:.15s; }
.pack-card:nth-child(1) { animation-delay:.2s; }
.pack-card:nth-child(2) { animation-delay:.25s; }
.pack-card:nth-child(3) { animation-delay:.3s; }

/* Org */
.org-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:16px; margin-bottom:22px; }
.summary-card { padding:18px 20px; display:grid; gap:6px; background:rgba(255,255,255,0.92); border-radius:18px; border:1px solid var(--panel-outline); box-shadow:var(--shadow-md); text-align:center; }
.summary-label { font-size:11px; text-transform:uppercase; letter-spacing:0.16em; color:var(--muted); font-weight:600; }
.summary-value { font-size:26px; font-weight:700; color:var(--primary-dark); }
.org-modes { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.mode-btn { padding:8px 16px; border-radius:999px; border:1px solid rgba(81,99,255,0.18); background:rgba(255,255,255,0.9); font-weight:600; color:var(--muted-strong); cursor:pointer; }
.mode-btn--active { background:var(--primary); color:#fff; border-color:transparent; box-shadow:0 14px 32px rgba(81,99,255,0.28); }

.admin-layout { display:grid; grid-template-columns:minmax(260px,320px) minmax(0,1fr); gap:22px; align-items:start; }
.admin-clients { display:grid; gap:16px; }
.admin-client-browser { display:grid; gap:10px; padding:14px; border-radius:18px; background:rgba(255,255,255,0.92); border:1px solid rgba(33,52,126,0.08); box-shadow:var(--shadow-md); }
.browser-header { display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:600; color:var(--muted); }
.browser-item { border:1px solid transparent; border-radius:14px; background:#fff; padding:12px 14px; display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); transition:border .2s ease, box-shadow .2s ease, transform .2s ease; text-align:left; }
.browser-item:hover { border-color:rgba(81,99,255,0.25); box-shadow:0 12px 26px rgba(81,99,255,0.12); transform:translateY(-2px); }
.browser-item--active { border-color:var(--primary); background:rgba(81,99,255,0.14); color:var(--primary-dark); box-shadow:0 12px 28px rgba(81,99,255,0.2); }
.browser-name { font-weight:600; }
.browser-meta { font-size:11px; letter-spacing:0.04em; text-transform:uppercase; }

.org-content { display:grid; gap:18px; }
.org-focus { display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-radius:20px; border:1px solid var(--panel-outline); background:rgba(255,255,255,0.95); box-shadow:var(--shadow-md); }
.org-focus__members { display:flex; gap:8px; flex-wrap:wrap; }
.org-focus__members span { background:rgba(81,99,255,0.15); color:var(--primary-dark); padding:5px 10px; border-radius:999px; font-size:12px; font-weight:600; }

.org-view { min-height:320px; }
.org-tree { --line: rgba(33,52,126,0.18); display:flex; justify-content:center; overflow:auto; padding:10px; }
.org-tree ul { padding-top:20px; position:relative; display:flex; justify-content:center; gap:16px; margin:0; }
.org-tree li { list-style:none; position:relative; padding:20px 12px 0; }
.org-tree li::before, .org-tree li::after { content:""; position:absolute; top:0; right:50%; border-top:1px solid var(--line); width:50%; height:20px; }
.org-tree li::after { right:auto; left:50%; border-left:1px solid var(--line); }
.org-tree li:only-child::after, .org-tree li:only-child::before { display:none; }
.org-tree li:first-child::before { border:none; }
.org-tree li:last-child::after { border:none; }
.org-tree ul ul::before { content:""; position:absolute; top:0; left:50%; border-left:1px solid var(--line); width:0; height:20px; }
.org-node { min-width:220px; padding:16px 18px; border-radius:18px; background:#fff; border:1px solid rgba(33,52,126,0.12); box-shadow:0 14px 32px rgba(15,34,76,0.14); display:grid; gap:6px; text-align:left; }
.org-node__title { font-weight:600; font-size:15px; color:var(--muted-strong); }
.org-node__subtitle { font-size:12px; color:var(--muted); }
.org-node__members { display:flex; flex-wrap:wrap; gap:6px; }
.org-node__members span { font-size:11px; padding:4px 8px; border-radius:999px; background:rgba(81,99,255,0.18); color:var(--primary-dark); }
.org-node--active { border-color:var(--primary); box-shadow:0 16px 40px rgba(81,99,255,0.25); }
.org-node--highlight { background:linear-gradient(135deg, rgba(81,99,255,0.2), rgba(24,180,255,0.16)); }
.org-directory { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; }
.org-card { padding:18px 20px; border-radius:20px; border:1px solid rgba(33,52,126,0.08); background:#fff; box-shadow:var(--shadow-md); display:grid; gap:12px; }
.org-card__header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.org-card__members { display:flex; flex-wrap:wrap; gap:6px; }
.org-card__members span { padding:4px 9px; border-radius:999px; background:rgba(81,99,255,0.12); color:var(--primary-dark); font-size:12px; }
.org-card__members .more { background:rgba(81,99,255,0.18); }

/* Risks */
.list ul { margin:0; padding-left:18px; color:var(--muted); font-size:13px; }

/* Confide */
#confideForm textarea { min-height:140px; resize:vertical; }

/* Utilities */
.muted { color:var(--muted); }
canvas { width:100%; height:200px; }

.admin-ticket-panel { border:1px solid var(--panel-outline); border-radius:22px; background:rgba(255,255,255,0.94); box-shadow:var(--shadow-md); padding:24px; display:grid; gap:18px; }
.admin-ticket-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; }
.filter-group { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
.filter-label { font-size:11px; text-transform:uppercase; letter-spacing:0.16em; color:var(--muted); font-weight:600; }
.filter-pill { border:1px solid rgba(81,99,255,0.18); border-radius:999px; padding:6px 12px; font-size:12px; font-weight:600; background:rgba(255,255,255,0.86); color:var(--muted-strong); }
.filter-pill--active { border-color:var(--primary); background:rgba(81,99,255,0.16); color:var(--primary-dark); box-shadow:0 10px 24px rgba(81,99,255,0.2); }

@keyframes pulse {
  0% { transform:scale(1); opacity:1; }
  50% { transform:scale(1.2); opacity:0.4; }
  100% { transform:scale(1); opacity:1; }
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(14px); }
  to { opacity:1; transform:translateY(0); }
}

/* Responsive */
@media (max-width:1100px) {
  .landing { grid-template-columns:1fr; padding:64px 36px; }
  .landing-panel { order:-1; }
}
@media (max-width:960px) {
  .layout { grid-template-columns:minmax(0,1fr); grid-template-areas:"header" "main"; }
  .sidebar { position:fixed; top:0; bottom:0; left:-280px; width:250px; padding-top:80px; z-index:100; box-shadow:26px 0 60px rgba(15,34,76,0.2); transition:left .28s ease; }
  body.nav-open .sidebar { left:0; }
  .header { position:sticky; top:0; z-index:90; background:rgba(255,255,255,0.92); }
}
@media (max-width:640px) {
  .landing { padding:50px 24px; gap:32px; }
  .landing-panel { padding:32px; }
  .landing-cta { padding:30px; border-radius:22px; }
  .main { padding:24px 22px 60px; }
  .admin-layout { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  .landing { padding:48px 20px; }
  .landing-panel { padding:28px; }
  .landing-cta { flex-direction:column; align-items:flex-start; gap:16px; }
  .landing-cta h2 { font-size:24px; }
}
