:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --line: #e5e9f0;
  --line-strong: #d8dee8;
  --text: #172033;
  --muted: #667085;
  --muted-2: #8a94a6;
  --navy: #17324d;
  --blue: #3267a8;
  --teal: #407f87;
  --blue-soft: #edf4ff;
  --teal-soft: #edf8f7;
  --green: #2f7d57;
  --green-soft: #edf7f1;
  --amber: #9a6a12;
  --amber-soft: #fff6e4;
  --red: #a84a4a;
  --red-soft: #fff1f1;
  --slate-soft: #f1f4f8;
  --shadow: 0 18px 40px rgba(22, 34, 51, .08);
  --shadow-soft: 0 8px 24px rgba(22, 34, 51, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 270px;
  --topbar: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.45;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: linear-gradient(180deg, #fbfcfe 0, #f2f5f9 100%);
}

.login-brand {
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
  background: radial-gradient(circle at 20% 20%, rgba(50, 103, 168, .08), transparent 32%), radial-gradient(circle at 80% 65%, rgba(64, 127, 135, .08), transparent 28%);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  color: var(--navy);
  letter-spacing: -.02em;
}

.logo-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--navy);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(23, 50, 77, .18);
}

.login-brand h1 {
  font-size: 48px;
  line-height: 1.06;
  letter-spacing: -.05em;
  margin: 0;
  max-width: 720px;
  color: #132238;
}

.login-brand p {
  font-size: 17px;
  color: var(--muted);
  max-width: 650px;
  margin: 0;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  max-width: 620px;
}

.benefit {
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #344054;
  box-shadow: var(--shadow-soft);
}

.check {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
}

.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -.035em;
}

.login-card .sub {
  margin: 0 0 26px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  color: #344054;
  font-weight: 650;
}

.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  padding: 11px 12px;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #9eb9da;
  box-shadow: 0 0 0 4px rgba(50, 103, 168, .10);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--muted);
}

.remember {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link {
  color: var(--blue);
  font-weight: 650;
}

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 14px;
  background: #fff;
  color: #243044;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: .16s ease;
  min-height: 40px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.btn-primary:hover {
  background: #203d5b;
}

.btn-secondary {
  border-color: var(--line-strong);
  background: #fff;
}

.btn-muted {
  background: var(--slate-soft);
  border-color: var(--line);
  color: #334155;
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #ffd7d7;
}

.btn-wide {
  width: 100%;
}

.btn-sm {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.btn-icon {
  width: 40px;
  padding: 0;
  border-color: var(--line-strong);
  background: #fff;
}

.login-help {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px 18px;
}

.side-brand .logo-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.side-brand strong {
  font-size: 17px;
}

.side-brand small {
  display: block;
  color: var(--muted);
  font-weight: 550;
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.nav button {
  border: 0;
  background: transparent;
  color: #475467;
  border-radius: 11px;
  padding: 10px 11px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
}

.nav button:hover {
  background: #f2f5f9;
  color: #1f2a3d;
}

.nav button.active {
  background: var(--blue-soft);
  color: var(--navy);
}

.nav-ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f3f6fa;
  display: grid;
  place-items: center;
  color: #5e6b7c;
  font-size: 12px;
}

.nav button.active .nav-ico {
  background: #dfeeff;
  color: var(--blue);
}

.workspace-card {
  margin-top: auto;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
}

.workspace-card .mini {
  color: var(--muted);
  font-size: 12px;
}

.workspace-card strong {
  display: block;
  margin: 2px 0 10px;
}

.workspace-card .support {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}

.main {
  min-width: 0;
}

.topbar {
  height: var(--topbar);
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(246, 248, 251, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
}

.mobile-menu {
  display: none;
}

.global-search {
  flex: 1;
  position: relative;
}

.global-search input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px 12px 42px;
  outline: none;
}

.global-search:before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 8px;
  color: var(--muted);
  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dfe7f1;
  color: #20364f;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.dropdown-wrap {
  position: relative;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 40;
}

.dropdown.open {
  display: block;
}

.dropdown button, .dropdown a {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 11px;
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #344054;
  font-weight: 650;
}

.dropdown button:hover, .dropdown a:hover {
  background: #f5f7fa;
}

.notification-list {
  min-width: 320px;
}

.notif {
  padding: 10px;
  border-radius: 10px;
  border-bottom: 1px solid #f1f3f6;
}

.notif:last-child {
  border-bottom: 0;
}

.notif strong {
  display: block;
  font-size: 13px;
}

.notif span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 28px;
  max-width: 1700px;
  margin: 0 auto;
}

.page {
  display: none;
  animation: fadeIn .18s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: .6;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 800;
}

.page-title {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.04em;
  margin: 2px 0 6px;
}

.page-desc {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
}

.filters input, .filters select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 160px;
  outline: none;
  color: #344054;
}

.filters input {
  min-width: 260px;
}

.grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(22, 34, 51, .02);
}

.card-pad {
  padding: 18px;
}

.kpi-card {
  padding: 17px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.kpi-value {
  font-size: 28px;
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 4px 0;
}

.trend {
  font-size: 12px;
  color: var(--green);
  font-weight: 750;
}

.trend.down {
  color: var(--red);
}

.section-grid {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 16px;
}

.section-grid.equal {
  grid-template-columns: 1fr 1fr;
}

.section-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 {
  font-size: 17px;
  margin: 0;
  letter-spacing: -.02em;
}

.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-summary {
  display: grid;
  gap: 11px;
}

.stage-row {
  display: grid;
  grid-template-columns: 140px 1fr 92px;
  align-items: center;
  gap: 13px;
}

.stage-row .name {
  font-weight: 750;
  color: #344054;
}

.bar-track {
  height: 9px;
  background: #eff3f8;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
}

.stage-value {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: #fff;
}

.list-row .title {
  font-weight: 760;
}

.list-row .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.activity {
  position: relative;
  padding-left: 28px;
}

.activity:before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #edf1f6;
}

.activity-item {
  position: relative;
  margin-bottom: 14px;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-item:before {
  content: "";
  position: absolute;
  left: -24px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
}

.activity-item strong {
  display: block;
  font-size: 14px;
}

.activity-item span {
  color: var(--muted);
  font-size: 12px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.source-pill {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.source-pill .top {
  display: flex;
  justify-content: space-between;
  font-weight: 750;
}

.source-pill .bar-track {
  height: 7px;
  margin-top: 9px;
}

.chart-bars {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 14px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 0;
  margin-top: 12px;
}

.chart-bar {
  flex: 1;
  min-width: 18px;
  background: #dbe7f5;
  border-radius: 8px 8px 0 0;
  position: relative;
}

.chart-bar span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
}

.chart-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 28px;
}

.line-chart {
  width: 100%;
  height: 220px;
}

.line-chart text {
  fill: var(--muted);
  font-size: 11px;
}

.line-chart .gridline {
  stroke: #edf1f6;
}

.line-chart .line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}

.line-chart .area {
  fill: #edf4ff;
}

.line-chart .dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.table th {
  background: #f8fafc;
  color: #64748b;
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .055em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: #334155;
}

.table tr:hover td {
  background: #fbfcfe;
}

.contact-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eef6;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #28435f;
  font-size: 12px;
}

.muted {
  color: var(--muted) !important;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #d7e8fb;
}

.badge-teal {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: #d4ecea;
}

.badge-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: #d7ecdF;
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #ffe4ad;
}

.badge-red {
  background: var(--red-soft);
  color: var(--red);
  border-color: #ffd6d6;
}

.badge-slate {
  background: #f1f4f8;
  color: #536273;
  border-color: #e2e7ef;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.priority-low {
  background: #f1f4f8;
  color: #536273;
}

.priority-medium {
  background: #edf4ff;
  color: #3267a8;
}

.priority-high {
  background: #fff6e4;
  color: #9a6a12;
}

.priority-urgent {
  background: #fff1f1;
  color: #a84a4a;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #e8eff8;
  color: #1d3b5d;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
}

.profile-title h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -.03em;
}

.profile-title p {
  margin: 3px 0 0;
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.info-item small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.info-item strong {
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #eef2f6;
  border-radius: 13px;
  margin-bottom: 14px;
  overflow: auto;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 750;
  color: #617085;
}

.tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.right-panel {
  position: sticky;
  top: 92px;
  align-self: start;
}

.action-list {
  display: grid;
  gap: 9px;
}

.action-list .btn {
  justify-content: flex-start;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: #fff;
}

.note-card + .note-card {
  margin-top: 9px;
}

.task-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 9px;
}

.linked-ref {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-col {
  flex: 0 0 280px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 520px;
  padding: 12px;
}

.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kanban-head h3 {
  font-size: 14px;
  margin: 0;
}

.kanban-head span {
  color: var(--muted);
  font-size: 12px;
}

.deal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 11px;
  box-shadow: 0 1px 0 rgba(22, 34, 51, .02);
}

.deal-card:hover {
  border-color: #cdd7e5;
  box-shadow: var(--shadow-soft);
}

.deal-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.deal-card .client {
  color: var(--muted);
  font-size: 12px;
}

.deal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.deal-meta div {
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
}

.deal-meta strong {
  display: block;
  color: #25344d;
}

.probability {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.probability .bar-track {
  flex: 1;
  height: 7px;
}

.deal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.slide-over {
  position: fixed;
  right: -500px;
  top: 0;
  width: min(480px, 100%);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 80;
  transition: .24s ease;
  display: flex;
  flex-direction: column;
}

.slide-over.open {
  right: 0;
}

.slide-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.slide-head h2 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -.03em;
}

.slide-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, .24);
  backdrop-filter: blur(2px);
  z-index: 70;
  display: none;
}

.overlay.open {
  display: block;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(.98);
  width: min(760px, calc(100% - 32px));
  max-height: 92vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  z-index: 90;
  display: none;
  overflow: hidden;
}

.modal.open {
  display: block;
  animation: modalIn .16s ease forwards;
}

@keyframes modalIn {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-head, .modal-foot {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  gap: 10px;
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
}

.modal-body {
  padding: 20px;
  overflow: auto;
  max-height: calc(92vh - 140px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.close {
  border: 0;
  background: #f2f5f9;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  color: #536273;
}

.view-switcher {
  display: inline-flex;
  background: #eef2f6;
  border-radius: 13px;
  padding: 5px;
}

.view-switcher button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  color: #64748b;
  font-weight: 750;
}

.view-switcher button.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.calendar-day {
  min-height: 112px;
  background: #fff;
  padding: 10px;
}

.calendar-day.head {
  min-height: auto;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.date-num {
  font-weight: 800;
  color: #344054;
}

.cal-item {
  margin-top: 8px;
  border-radius: 9px;
  padding: 6px 7px;
  background: var(--blue-soft);
  color: #265382;
  font-size: 11px;
  font-weight: 750;
}

.cal-item.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.cal-item.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.cal-empty {
  background: #fbfcfe;
  color: #c4cad4;
}

.agenda-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 10px;
}

.agenda-item .time {
  font-weight: 800;
  color: var(--navy);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.performance {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--pct), #edf1f6 0);
  display: grid;
  place-items: center;
}

.progress-ring:after {
  content: attr(data-label);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #344054;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.integration-card {
  padding: 18px;
}

.integration-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 900;
  margin-bottom: 14px;
}

.integration-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.integration-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  min-height: 38px;
}

.integration-actions {
  display: flex;
  gap: 8px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.settings-menu {
  padding: 8px;
  display: grid;
  gap: 4px;
}

.settings-menu button {
  border: 0;
  background: #fff;
  text-align: left;
  border-radius: 11px;
  padding: 10px 12px;
  color: #536273;
  font-weight: 750;
}

.settings-menu button.active, .settings-menu button:hover {
  background: var(--blue-soft);
  color: var(--navy);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
}

.service-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.empty-state {
  padding: 30px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #fbfcfe;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: #344054;
  margin-bottom: 4px;
}

.confirm-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
  padding: 20px;
}

.confirm-dialog.open {
  display: block;
}

.confirm-dialog h3 {
  margin: 0 0 6px;
}

.confirm-dialog p {
  color: var(--muted);
  margin: 0 0 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #172033;
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 120;
  display: none;
}

.toast.open {
  display: block;
  animation: toastIn .2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media(max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section-grid, .section-grid.equal, .section-grid.three, .detail-layout, .calendar-layout, .settings-layout {
    grid-template-columns: 1fr;
  }
  .right-panel {
    position: static;
  }
  .integration-grid, .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 42px;
  }
  .login-brand h1 {
    font-size: 38px;
  }
  .login-panel {
    padding: 30px;
  }
  .sidebar {
    position: fixed;
    left: -290px;
    transition: .22s ease;
  }
  .sidebar.open {
    left: 0;
    box-shadow: var(--shadow);
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .content {
    padding: 22px;
  }
  .topbar {
    padding: 0 18px;
  }
}

@media(max-width: 720px) {
  .kpi-grid, .integration-grid, .report-grid, .benefit-grid, .form-grid, .info-grid, .source-grid {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
  }
  .filters input, .filters select {
    width: 100%;
    min-width: 0;
  }
  .top-actions .btn span {
    display: none;
  }
  .login-brand {
    padding: 30px 22px;
  }
  .login-brand h1 {
    font-size: 32px;
  }
  .login-panel {
    padding: 22px;
  }
  .login-card {
    padding: 24px;
  }
  .content {
    padding: 18px;
  }
  .calendar-grid {
    min-width: 760px;
  }
  .calendar-scroll {
    overflow: auto;
  }
  .section-grid {
    gap: 14px;
  }
  .table {
    min-width: 900px;
  }
  .kanban {
    grid-template-columns: repeat(6, 235px);
  }
}
