﻿:root {
  --primary: #3dbfb0;
  --accent: #5dd9c1;
  --navy: #1e3a5f;
  --bg: #f8fafb;
  --text: #1a202c;
  --muted: #64748b;
  --card: #ffffff;
  --border: #dfe7ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --s1: 0 4px 12px rgba(15, 23, 42, 0.06);
  --s2: 0 10px 24px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 440px at 100% -5%, rgba(93, 217, 193, 0.22), transparent 55%),
    radial-gradient(900px 380px at -10% 100%, rgba(61, 191, 176, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }

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

.sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfefe 0%, #f2f8fa 100%);
  padding: 22px 16px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
}

.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background-color: #eef6fb;
  background-image: url("/logo.png");
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(30, 58, 95, 0.14);
}

.nav { display: grid; gap: 8px; align-content: start; }

.nav-link {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: #40566f;
  font-weight: 600;
  background: transparent;
  text-align: left;
  transition: 0.2s;
}

.nav-link:hover { border-color: #d1dfeb; background: #fff; }
.nav-link.active {
  background: rgba(61, 191, 176, 0.13);
  color: #0f766e;
  border-color: rgba(61, 191, 176, 0.4);
}

.profile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 5px;
  box-shadow: var(--s1);
}

.profile-name { font-weight: 700; font-size: 0.92rem; color: #264360; }
.profile-company { color: var(--muted); font-size: 0.84rem; line-height: 1.35; }

.workspace { display: grid; grid-template-rows: auto 1fr; min-width: 0; }

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(248, 250, 251, 0.9);
  backdrop-filter: blur(8px);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 45;
}

.top-left, .top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-right { justify-content: flex-end; flex-wrap: wrap; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #cfe2ee;
  border-radius: 999px;
  background: #f5fbff;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #40607f;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: #1c3e5f;
}

.lang-btn.active {
  background: #2b6ea2;
  color: #fff;
}

.toggle {
  border: 1px solid var(--border);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #37506e;
}

.top-brand { font-weight: 800; color: var(--navy); white-space: nowrap; }
.quick-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-action {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2f4d6c;
  white-space: nowrap;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cfe2ee;
  background: #f5fbff;
  color: #35536f;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.period {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  height: 38px;
  padding: 0 12px;
  font-weight: 600;
  color: #304a67;
}

.notify {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  position: relative;
  color: #334e6b;
}

.ncount {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.73rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--danger);
  border: 2px solid #fff;
  font-weight: 700;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e4edf7, #f6fbff);
  border: 1px solid #d8e2ed;
  display: grid;
  place-items: center;
  font-size: 0.83rem;
  font-weight: 700;
  color: #2f4d6c;
}

.main { padding: 20px 24px 28px; min-width: 0; }
.stack { display: grid; gap: 20px; min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--s1);
}

.section-head { display: grid; gap: 4px; }
.section-title { margin: 0; color: #1d3553; font-size: clamp(1.1rem, 1.8vw, 1.45rem); }
.section-subtitle { margin: 0; color: var(--muted); font-size: 0.9rem; }

.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hero-card { padding: 15px; display: grid; gap: 11px; min-height: 194px; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-label { color: #49627d; font-size: 0.85rem; font-weight: 600; }
.hero-title { color: var(--navy); font-weight: 700; font-size: 0.96rem; }
.icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(61, 191, 176, 0.14);
  color: #0f766e;
  font-size: 1.05rem;
}
.value { font-size: clamp(1.4rem, 2vw, 1.9rem); font-weight: 800; color: #1c3658; letter-spacing: -0.015em; }
.sub { color: var(--muted); font-size: 0.84rem; line-height: 1.45; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 999px; padding: 4px 9px; font-size: 0.74rem; font-weight: 700; }
.b-w { background: rgba(245, 158, 11, 0.18); color: #9a5a05; }
.b-d { background: rgba(239, 68, 68, 0.14); color: #b42323; }
.b-s { background: rgba(16, 185, 129, 0.17); color: #117a4f; }
.spark { width: 100%; height: 42px; }
.spark path { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; }
.prog { display: grid; gap: 6px; }
.bar { height: 9px; border-radius: 999px; background: #ecf2f6; overflow: hidden; position: relative; }
.fill { position: absolute; inset: 0 auto 0 0; width: 90%; background: linear-gradient(90deg, var(--warning), #f8be56); }
.plabel { font-size: 0.78rem; color: #5f7590; font-weight: 600; }
.cal { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #5f7690; font-weight: 600; }
.cal-mini { width: 18px; height: 18px; border: 1px solid #c6d3df; border-radius: 5px; position: relative; background: #fff; }
.cal-mini::before { content: ""; position: absolute; inset: 3px 3px auto; height: 4px; border-radius: 3px; background: #dbe7f1; }

.insights { padding: 16px; display: grid; gap: 12px; }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ins-card { border: 1px solid var(--border); border-radius: 11px; background: #fff; padding: 14px; display: grid; gap: 12px; }
.ins-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { border-radius: 999px; padding: 4px 8px; font-size: 0.71rem; font-weight: 800; }
.tag-r { background: rgba(239, 68, 68, 0.12); color: #b42323; }
.tag-o { background: rgba(245, 158, 11, 0.17); color: #925601; }
.tag-g { background: rgba(16, 185, 129, 0.14); color: #0f7a50; }
.tag-s { background: #ecf2f8; color: #4c6784; }
.ins-title { margin: 0; color: #1c3555; font-size: 0.98rem; line-height: 1.3; }
.ins-body { margin: 0; color: #48627d; font-size: 0.84rem; line-height: 1.5; }
.hl { border: 1px solid rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.08); border-radius: 9px; padding: 8px 10px; font-weight: 700; color: #a82929; font-size: 0.82rem; }
.ins-foot { border-top: 1px dashed #d6e2ec; border-radius: 9px; padding: 10px; background: linear-gradient(180deg, rgba(93, 217, 193, 0.09), rgba(93, 217, 193, 0.03)); color: #3f5b77; font-size: 0.81rem; line-height: 1.45; }

.cash { padding: 16px; display: grid; gap: 14px; }
.cash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tg { display: inline-flex; gap: 6px; border: 1px solid var(--border); padding: 4px; border-radius: 10px; background: #fff; }
.tg button { border: 0; border-radius: 8px; background: transparent; padding: 7px 11px; font-size: 0.82rem; font-weight: 700; color: #49627d; cursor: pointer; }
.tg button.active { background: rgba(61, 191, 176, 0.16); color: #0f766e; }
.chart { border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, #fcfeff 0%, #f5fafe 100%); padding: 10px; position: relative; overflow: hidden; }
.chart svg { width: 100%; height: auto; display: block; }
.z-d { fill: rgba(239, 68, 68, 0.08); }
.z-w { fill: rgba(245, 158, 11, 0.1); }
.grid line { stroke: #e2eaf1; stroke-width: 1; }
.al { fill: #5e7591; font-size: 12px; font-weight: 600; }
.line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.35; }
.line.optimist { stroke: var(--success); }
.line.realist { stroke: #2b6ea2; }
.line.pesimist { stroke: var(--danger); }
.line.active { opacity: 1; stroke-width: 4; }
.pt { r: 4; stroke: #fff; stroke-width: 1.5; opacity: 0.26; }
.pt.active { opacity: 1; }
.now { stroke: #41648a; stroke-dasharray: 5 6; stroke-width: 1.6; }
.mt { font-size: 11px; fill: #36567a; font-weight: 700; }
.tip { position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -110%); background: #123254; color: #eef6ff; border-radius: 10px; padding: 10px 11px; min-width: 170px; z-index: 20; }
.tm { font-size: 0.78rem; font-weight: 700; margin-bottom: 7px; color: #bcd4ec; }
.tl { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.78rem; margin-bottom: 4px; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; margin-right: 6px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.m { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px; display: grid; gap: 5px; }
.m-title { margin: 0; color: #58718b; font-size: 0.78rem; font-weight: 600; }
.m-val { margin: 0; color: #173454; font-size: 1.12rem; font-weight: 800; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-card { padding: 14px; display: grid; gap: 8px; }
.summary-label { font-size: 0.78rem; color: #5f7590; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.summary-value { font-size: 1.25rem; font-weight: 800; color: #173454; }
.summary-note { margin: 0; font-size: 0.8rem; color: #607891; }

.table-card { padding: 16px; display: grid; gap: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; min-width: 880px; background: #fff; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid #e7edf3; text-align: left; font-size: 0.84rem; }
.table th { background: #f8fbff; color: #3f5b77; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: 0; }
.pill { border-radius: 999px; padding: 4px 8px; font-size: 0.72rem; font-weight: 700; display: inline-flex; }
.pill.ok { background: rgba(16, 185, 129, 0.15); color: #0f7a50; }
.pill.pending { background: rgba(245, 158, 11, 0.18); color: #925601; }
.pill.review { background: rgba(239, 68, 68, 0.12); color: #b42323; }

.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.chat-thread { padding: 16px; display: grid; gap: 12px; }
.msg { border-radius: 10px; padding: 10px 11px; font-size: 0.84rem; line-height: 1.5; white-space: pre-line; }
.msg.user { margin-left: auto; background: #e8f0f7; color: #1e3f62; border: 1px solid #d3e1ed; max-width: 94%; }
.msg.acc { background: rgba(93, 217, 193, 0.12); color: #244a63; border: 1px solid rgba(61, 191, 176, 0.33); max-width: 98%; }
.msg-meta { font-size: 0.75rem; color: #69829b; margin-bottom: 4px; font-weight: 700; }
.todo-list { padding: 16px; display: grid; gap: 10px; }
.todo-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; font-size: 0.84rem; color: #3f5b77; }

.reports-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-card { padding: 16px; display: grid; gap: 10px; }
.report-title { margin: 0; font-size: 1rem; color: #1c3555; }
.report-body { margin: 0; font-size: 0.84rem; color: #48627d; line-height: 1.5; }

.live-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 130;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.live-chat-launcher {
  border: 1px solid #0f766e;
  background: linear-gradient(180deg, #3dbfb0, #2fa99b);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--s2);
}

.live-chat-panel { width: min(360px, calc(100vw - 24px)); display: none; }
.live-chat.open .live-chat-panel { display: block; }
.chat-widget { padding: 12px; display: grid; gap: 10px; }
.chat-head { display: flex; align-items: center; gap: 10px; }
.bot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: #eef6fb;
  background-image: url("/logo.png");
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(30, 58, 95, 0.14);
  display: grid;
  place-items: center;
}
.chat-title { margin: 0; font-size: 0.95rem; color: #214264; }
.chat-sub { margin: 2px 0 0; color: #62809c; font-size: 0.78rem; }
.live-chat-close { margin-left: auto; border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: #3f5f80; font-weight: 800; }
.chat-box { border: 1px solid var(--border); border-radius: 10px; padding: 11px; background: #fdfefe; display: grid; gap: 9px; max-height: 420px; overflow: auto; }
.chat-input { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px 11px; color: #6a839c; font-size: 0.83rem; }
.typing { display: none; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; width: fit-content; background: #e8eef6; border: 1px solid #d6e0ea; }
.typing.show { display: inline-flex; }
.typing span { width: 7px; height: 7px; border-radius: 999px; background: #54718f; animation: bounce 0.7s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.1s; }
.typing span:nth-child(3) { animation-delay: 0.2s; }
.qa { display: flex; gap: 8px; flex-wrap: wrap; }
.qa button { border: 1px solid var(--border); border-radius: 9px; background: #fff; color: #2f4d6c; font-size: 0.76rem; font-weight: 700; padding: 8px 10px; cursor: pointer; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.sidebar-collapsed .shell { grid-template-columns: 84px 1fr; }
.sidebar-collapsed .sidebar { padding-inline: 10px; }
.sidebar-collapsed .logo-label,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .profile-name,
.sidebar-collapsed .profile-company { display: none; }
.sidebar-collapsed .nav-link { text-align: center; padding-inline: 8px; }
.sidebar-collapsed .profile { min-height: 44px; place-items: center; padding: 10px; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(18, 31, 46, 0.35); border: 0; z-index: 55; }

@media (max-width: 1280px) {
  .quick-actions { display: none; }
}

@media (max-width: 1120px) {
  .hero-grid,
  .ins-grid,
  .metrics,
  .summary-grid,
  .reports-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    transform: translateX(-102%);
    transition: transform 0.24s;
  }
  .mobile-sidebar-open .sidebar { transform: translateX(0); }
  .mobile-sidebar-open .overlay { display: block; }
  .topbar { padding-inline: 14px; }
  .main { padding-inline: 14px; }
  .live-chat { right: 12px; bottom: 12px; }
}
