:root {
  --navy: #082542;
  --navy-2: #061d36;
  --navy-3: #0d3158;
  --gold: #d3b257;
  --gold-2: #c8a246;
  --ink: #121826;
  --text: #293241;
  --muted: #697386;
  --soft: #f6f7f9;
  --line: #e5e7eb;
  --line-2: #d7dce3;
  --white: #ffffff;
  --green: #18b87a;
  --green-soft: #e9fbf2;
  --blue: #2d6cdf;
  --blue-soft: #edf4ff;
  --orange: #f26a21;
  --orange-soft: #fff3e8;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --shadow: 0 16px 34px rgba(16, 24, 40, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--soft);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--soft);
}

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  min-height: 100vh;
  background: var(--navy);
  color: #dce7f4;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  height: 76px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-mark {
  width: 54px;
  height: 40px;
  border-radius: 7px;
  background: #030507;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 19px;
  position: relative;
}

.logo-mark::after {
  content: "CONSULTING";
  position: absolute;
  bottom: 6px;
  font-size: 5px;
  letter-spacing: 1.2px;
  color: #c8d1dc;
}

.brand-copy strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.15;
}

.brand-copy span {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 11px;
  line-height: 1.2;
}

.close-rail {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #b7c4d4;
}

.role-panel {
  padding: 14px 14px 8px;
}

.role-panel label {
  display: block;
  margin: 0 0 7px;
  color: #aab8c9;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-select {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0 12px;
  outline: none;
}

.role-select option {
  color: var(--ink);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 14px;
}

.nav-item {
  height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #dce7f4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(211, 178, 87, 0.55);
  color: #fff;
}

.nav-item svg,
.nav-item i {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gate-card {
  border: 1px solid rgba(211, 178, 87, 0.24);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 12px;
  color: #c9d7e6;
  font-size: 12px;
  line-height: 1.45;
}

.gate-card strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.menu-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  display: none;
  align-items: center;
  justify-content: center;
}

.topbar-title {
  color: var(--navy);
  font-weight: 800;
  font-size: 18px;
}

.topbar-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--gold);
}

.icon-btn svg,
.icon-btn i {
  width: 18px;
  height: 18px;
}

.dot {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.avatar.navy {
  background: var(--navy);
  color: #fff;
}

.avatar.green {
  background: #d9fbe9;
  color: #109463;
}

.user-meta strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.user-meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 28px 30px 58px;
}

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

.page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
}

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

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.grid.sidebar-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card.pad {
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.card-header h2,
.card-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

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

.metric-card {
  min-height: 122px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #faf7ed;
  color: var(--gold-2);
  display: grid;
  place-items: center;
}

.metric-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.metric-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.metric-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.metric-icon svg,
.metric-icon i {
  width: 20px;
  height: 20px;
}

.trend {
  font-size: 12px;
  font-weight: 800;
}

.trend.up {
  color: var(--green);
}

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

.metric-value {
  margin-top: 18px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.btn {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--gold);
}

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

.btn.primary:hover {
  background: var(--navy-3);
}

.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.btn.danger {
  border-color: #fecaca;
  color: var(--red);
}

.btn.ghost {
  background: transparent;
}

.btn.disabled,
.btn:disabled {
  opacity: 0.55;
  background: #e5e7eb;
  border-color: #e5e7eb;
  color: #7b8190;
}

.btn svg,
.btn i {
  width: 18px;
  height: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.input-wrap svg,
.input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #9aa4b2;
}

.search-input,
.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-input {
  height: 42px;
  padding: 0 14px 0 42px;
}

.field,
.select {
  height: 52px;
  padding: 0 14px;
}

.textarea {
  min-height: 118px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

.search-input:focus,
.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(211, 178, 87, 0.14);
}

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

.form-grid.one {
  grid-template-columns: 1fr;
}

.span-2 {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: #5f6878;
  font-size: 12px;
  font-weight: 800;
}

.table-card {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 15px 14px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: middle;
}

th {
  color: #4b5565;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #3a4454;
  font-size: 14px;
}

tbody tr:hover {
  background: #fbfcfd;
}

.status-pill {
  min-width: 94px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-in-progress,
.status-contract-sent,
.status-consultation-ready {
  background: var(--navy);
  color: #fff;
}

.status-completed,
.status-paid {
  background: var(--green);
  color: #073726;
}

.status-payment-pending,
.status-action-required,
.status-pending {
  background: var(--orange);
  color: #fff;
}

.status-awaiting-documents {
  background: #eef0f4;
  color: #4b5565;
}

.status-consultation-booked {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-application-submitted {
  background: #fef3c7;
  color: #92400e;
}

.status-failed {
  background: var(--red);
  color: #fff;
}

.priority-high {
  background: var(--red);
  color: #fff;
}

.priority-medium {
  background: var(--orange);
  color: #fff;
}

.priority-low {
  background: #eef0f4;
  color: #4b5565;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.progress-track {
  height: 7px;
  width: 120px;
  background: #e6e8ec;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.progress-text {
  min-width: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.table-action {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-action:hover {
  background: #faf7ed;
}

.table-action.red {
  color: var(--red);
}

.table-action svg,
.table-action i {
  width: 17px;
  height: 17px;
}

.chart {
  padding: 20px;
  min-height: 280px;
}

.chart-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 16px;
}

.bar-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  align-items: end;
  border-left: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  padding: 0 18px 22px;
  position: relative;
}

.bar-chart::before,
.line-chart::before {
  content: "";
  position: absolute;
  inset: 0 0 22px 0;
  background-image: linear-gradient(to top, rgba(203, 213, 225, 0.25) 1px, transparent 1px);
  background-size: 100% 44px;
  pointer-events: none;
}

.bar {
  position: relative;
  z-index: 1;
  height: calc(var(--value) * 1%);
  min-height: 22px;
  border-radius: 8px 8px 0 0;
  background: var(--gold);
}

.bar span {
  position: absolute;
  bottom: -24px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.line-chart {
  height: 220px;
  position: relative;
  border-left: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.line-chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pie-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  align-items: center;
  min-height: 220px;
}

.pie {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 45%, var(--green) 45% 75%, #f59e0b 75% 90%, #8b5cf6 90% 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5565;
  font-size: 13px;
  font-weight: 600;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.client-list {
  display: grid;
}

.client-list-item {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #edf0f3;
}

.client-list-item:last-child {
  border-bottom: 0;
}

.client-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.client-person strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.client-person span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hero-banner {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
}

.hero-banner h1 {
  margin: 0;
  font-size: 28px;
}

.hero-banner p {
  margin: 8px 0 0;
  color: #d4deea;
}

.next-step {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.next-step + .next-step {
  margin-top: 12px;
}

.next-step.done {
  background: var(--green-soft);
  border-color: #bbf7d0;
}

.next-step-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: var(--orange);
  flex: 0 0 auto;
}

.next-step.done .step-icon {
  background: #dcfce7;
  color: var(--green);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 35px;
  bottom: 0;
  width: 2px;
  background: #e1e5ec;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d1d7e2;
  color: #fff;
  z-index: 1;
}

.timeline-dot.done {
  background: var(--green);
}

.timeline-dot.current {
  background: var(--gold);
}

.timeline-body strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.timeline-body span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions .btn {
  width: 100%;
}

.warning-box,
.success-box,
.info-box {
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}

.warning-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #7c4a03;
}

.success-box {
  background: var(--green-soft);
  border: 1px solid #bbf7d0;
  color: #0f5132;
}

.info-box {
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.warning-box svg,
.success-box svg,
.info-box svg,
.warning-box i,
.success-box i,
.info-box i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.wizard {
  max-width: 1040px;
  margin: 0 auto;
}

.wizard-card {
  padding: 36px 42px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0 34px;
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #8d95a3;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line-2);
  z-index: 0;
}

.step:first-child::before {
  display: none;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #a8adb5;
  color: #fff;
  z-index: 1;
  font-size: 12px;
}

.step.active,
.step.done {
  color: var(--ink);
}

.step.active .step-num,
.step.done .step-num {
  background: var(--navy);
}

.wizard-section {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.wizard-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.wizard-section > p {
  margin: 6px 0 24px;
  color: var(--muted);
}

.wizard-actions {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.upload-zone {
  min-height: 152px;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px;
}

.upload-zone + .upload-zone {
  margin-top: 14px;
}

.upload-zone i,
.upload-zone svg {
  width: 36px;
  height: 36px;
  color: #9aa4b2;
  margin-bottom: 10px;
}

.upload-zone strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 13px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.choice {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  padding: 22px;
  min-height: 150px;
  text-align: left;
}

.choice.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(211, 178, 87, 0.2);
}

.choice i,
.choice svg {
  width: 28px;
  height: 28px;
  color: var(--gold-2);
}

.choice strong {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 18px;
}

.choice span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.summary-box {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 22px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: #4b5565;
}

.summary-line.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
  color: var(--ink);
  font-weight: 800;
}

.agreement-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 24px;
  max-height: 500px;
  overflow: auto;
  line-height: 1.7;
}

.agreement-copy h3 {
  margin: 0 0 14px;
}

.agreement-copy h4 {
  margin: 22px 0 8px;
  color: var(--ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.check-row input {
  width: 19px;
  height: 19px;
  accent-color: var(--navy);
}

.payment-method {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  margin-bottom: 12px;
  background: #fff;
}

.payment-method.active {
  border-color: var(--gold);
}

.method-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #8a94a6;
  position: relative;
}

.payment-method.active .method-dot {
  border-color: var(--navy);
}

.payment-method.active .method-dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--navy);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.calendar-head {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.calendar-head h2 {
  text-align: center;
  margin: 0;
}

.date-cell {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
}

.date-cell.muted {
  color: #c6cbd3;
}

.date-cell.selected {
  background: #2f6bea;
  color: #fff;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.time-slot {
  height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.time-slot.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(211, 178, 87, 0.2);
}

.time-slot.booked,
.time-slot:disabled {
  background: #f2f4f7;
  color: #c2c7cf;
}

.booking-success {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.success-mark {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #d9fbe9;
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
}

.success-mark i,
.success-mark svg {
  width: 46px;
  height: 46px;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.doc-item {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.doc-item:last-child {
  border-bottom: 0;
}

.doc-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.doc-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #faf7ed;
  color: var(--gold-2);
  flex: 0 0 auto;
}

.doc-main strong {
  display: block;
  color: var(--ink);
}

.doc-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.notes-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.note-bubble {
  max-width: 78%;
  border-radius: var(--radius);
  background: #f2f5f8;
  padding: 12px 14px;
}

.note-bubble strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.note-bubble span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.task-list {
  display: grid;
  gap: 14px;
}

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

.task-card.completed {
  background: var(--green-soft);
  border-color: #bbf7d0;
}

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.task-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.task-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius);
  background: #f8fafc;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff9e8;
  color: var(--gold-2);
  display: grid;
  place-items: center;
}

.activity-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

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

.activity-tag {
  display: inline-flex;
  margin-left: 6px;
  height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.68);
  display: grid;
  place-items: center;
  padding: 26px;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.modal.wide {
  width: min(920px, 100%);
}

.modal-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.modal-body {
  padding: 22px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

.detail-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-profile h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  border-top: 1px solid #edf0f3;
  padding-top: 18px;
}

.detail-field span {
  display: block;
  color: #7b8494;
  margin-bottom: 6px;
  font-weight: 600;
}

.detail-field strong {
  color: var(--ink);
}

.modal-footer-note {
  margin-top: 22px;
  border-top: 1px solid #edf0f3;
  padding-top: 18px;
  color: #4b5565;
  line-height: 1.55;
}

.floating-help {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.floating-help i,
.floating-help svg {
  width: 24px;
  height: 24px;
}

#toast-root {
  position: fixed;
  right: 24px;
  top: 88px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 48px));
}

.toast {
  background: #101828;
  color: #fff;
  border-radius: var(--radius);
  padding: 13px 15px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  min-height: 250px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.empty-state i,
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--gold);
  margin-bottom: 14px;
}

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

.nowrap {
  white-space: nowrap;
}

.hide {
  display: none !important;
}

@media (max-width: 1180px) {
  .grid.metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.sidebar-layout,
  .document-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: 0;
    width: 100%;
    flex-basis: auto;
    position: static;
  }

  .brand {
    height: auto;
    min-height: 68px;
  }

  .role-panel,
  .sidebar-footer {
    display: none;
  }

  .nav-group {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 12px 14px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .topbar {
    position: static;
    padding: 0 18px;
  }

  .menu-button {
    display: inline-flex;
  }

  .content {
    padding: 22px 18px 70px;
  }

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

  .wizard-card {
    padding: 26px 22px;
  }

  .steps {
    overflow-x: auto;
    grid-template-columns: repeat(5, 150px);
    padding-bottom: 8px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 68px;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .user-meta {
    display: none;
  }

  .page-head {
    display: grid;
  }

  .page-head h1 {
    font-size: 24px;
  }

  .grid.metrics,
  .form-grid,
  .choice-grid,
  .detail-grid,
  .pie-wrap {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .input-wrap {
    min-width: 0;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-actions,
  .modal-actions {
    flex-direction: column-reverse;
  }

  .wizard-actions .btn,
  .modal-actions .btn {
    width: 100%;
  }

  .activity-item {
    grid-template-columns: 36px 1fr;
  }

  .activity-time {
    grid-column: 2;
  }

  .floating-help {
    right: 16px;
    bottom: 16px;
  }
}
