:root {
  --crm-primary: #f97316;
  --crm-primary-dark: #c2410c;
  --bs-primary: #f97316;
  --bs-primary-rgb: 249, 115, 22;
  --bs-link-color: #f97316;
  --bs-link-hover-color: #c2410c;
  --crm-ink: #20243a;
  --crm-muted: #85899d;
  --crm-border: #eceef4;
  --crm-bg: #f7f8fc;
  --sidebar-width: 250px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--crm-bg);
  color: var(--crm-ink);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--crm-border);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 26px 16px;
  position: fixed;
  top: 0;
  transition: transform .25s ease, width .25s ease, padding .25s ease;
  width: var(--sidebar-width);
  z-index: 1040;
}

.brand {
  align-items: center;
  color: var(--crm-ink);
  display: flex;
  font-size: 21px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: -.7px;
  margin: 0 10px 38px;
}

.brand-mark {
  align-items: center;
  background: var(--crm-primary);
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-label {
  color: #a1a4b3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  margin: 24px 12px 9px;
  text-transform: uppercase;
}

.side-link {
  align-items: center;
  border-radius: 9px;
  color: #777b90;
  display: flex;
  font-weight: 500;
  gap: 12px;
  margin: 3px 0;
  padding: 11px 12px;
  transition: background .2s, color .2s;
}

.side-link i {
  font-size: 17px;
}

.side-link:hover,
.side-link.active {
  background: #fff7ed;
  color: var(--crm-primary);
}

.sidebar-help {
  background: #fffaf5;
  border: 1px solid #ffedd5;
  border-radius: 12px;
  margin-top: 40px;
  padding: 16px;
}

.sidebar-help p {
  color: var(--crm-muted);
  font-size: 12px;
  line-height: 1.6;
}

.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left .25s ease;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.search-box {
  align-items: center;
  background: #f7f8fc;
  border: 1px solid #f0f1f5;
  border-radius: 9px;
  color: #9a9daf;
  display: flex;
  gap: 9px;
  max-width: 340px;
  padding: 9px 12px;
  width: 100%;
}

.search-box input {
  background: transparent;
  border: 0;
  color: var(--crm-ink);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 17px;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #777b90;
  display: inline-flex;
  font-size: 19px;
  justify-content: center;
  position: relative;
}

.notification-dot {
  background: #fb7185;
  border: 2px solid #fff;
  border-radius: 50%;
  height: 9px;
  position: absolute;
  right: -2px;
  top: 0;
  width: 9px;
}

.user-avatar {
  align-items: center;
  background: #ffedd5;
  border-radius: 50%;
  color: var(--crm-primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.content {
  margin: 0 auto;
  max-width: 1500px;
  padding: 30px 32px 48px;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
}

.page-heading h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.6px;
  margin: 0 0 6px;
}

.text-muted-custom {
  color: var(--crm-muted);
}

.role-label {
  font-size: 10px;
}

.small-copy {
  font-size: 11px;
}

.footer-copy {
  font-size: 10px;
}

.btn-primary {
  --bs-btn-bg: var(--crm-primary);
  --bs-btn-border-color: var(--crm-primary);
  --bs-btn-hover-bg: var(--crm-primary-dark);
  --bs-btn-hover-border-color: var(--crm-primary-dark);
}

.btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
}

.stat-card,
.panel {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(34, 39, 68, .025);
}

.stat-card {
  height: 100%;
  padding: 19px;
}

.stat-top {
  align-items: center;
  color: var(--crm-muted);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
}

.stat-icon {
  align-items: center;
  border-radius: 9px;
  display: inline-flex;
  font-size: 17px;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.stat-icon-orange {
  background: #fff7ed;
  color: #f97316;
}

.stat-icon-green {
  background: #e8f8f1;
  color: #18a879;
}

.stat-icon-yellow {
  background: #fff5df;
  color: #d39927;
}

.stat-icon-pink {
  background: #ffeef1;
  color: #ed6a82;
}

.stat-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.6px;
  margin: 14px 0 6px;
}

.stat-note {
  color: var(--crm-muted);
  font-size: 11px;
}

.trend-up {
  color: #18a879;
  font-weight: 600;
}

.trend-down {
  color: #ed6a82;
  font-weight: 600;
}

.panel {
  margin-top: 5px;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid #f0f1f5;
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.panel-body {
  padding: 20px;
}

.table {
  --bs-table-bg: transparent;
  margin: 0;
  vertical-align: middle;
}

.table thead th {
  background: #fafbfe;
  border-bottom: 1px solid var(--crm-border);
  color: #9296a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .55px;
  padding: 12px 15px;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  border-color: #f0f1f5;
  color: #62677c;
  font-size: 12px;
  padding: 14px 15px;
}

.customer {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 180px;
}

.customer-avatar {
  align-items: center;
  border-radius: 9px;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 10px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
}

.avatar-sarah {
  background: #fff7ed;
  color: #f97316;
}

.avatar-michael {
  background: #e5f5ff;
  color: #3294c7;
}

.avatar-olivia {
  background: #fff0e8;
  color: #dc8050;
}

.avatar-david {
  background: #e7f8ef;
  color: #32a477;
}

.customer-name {
  color: var(--crm-ink);
  font-size: 12px;
  font-weight: 600;
}

.customer-email {
  color: #a0a3b1;
  font-size: 10px;
  margin-top: 2px;
}

.status {
  border-radius: 20px;
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-active {
  background: #e8f8f1;
  color: #15956a;
}

.status-lead {
  background: #fff5df;
  color: #b78013;
}

.status-inactive {
  background: #f0f1f5;
  color: #777b8b;
}

.table-action {
  background: transparent;
  border: 0;
  color: #999daf;
  font-size: 17px;
}

.form-label {
  color: #555a70;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

.form-control,
.form-select {
  border-color: #e7e9f0;
  border-radius: 8px;
  font-size: 12px;
  min-height: 40px;
}

.form-control:focus,
.form-select:focus {
  border-color: #fdba74;
  box-shadow: 0 0 0 .2rem rgba(249, 115, 22, .12);
}

textarea.form-control {
  min-height: 90px;
}

.form-hint {
  color: #999daf;
  font-size: 10px;
  margin-top: 5px;
}

.login-page {
  align-items: center;
  background: var(--crm-bg);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  box-shadow: 0 16px 50px rgba(32, 36, 58, .08);
  max-width: 430px;
  padding: 38px;
  width: 100%;
}

.login-brand {
  color: var(--crm-ink);
  font-size: 20px;
  font-weight: 700;
}

.login-icon {
  align-items: center;
  background: #fff7ed;
  border-radius: 12px;
  color: var(--crm-primary);
  display: inline-flex;
  font-size: 22px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.login-back {
  color: var(--crm-muted);
  font-size: 12px;
}

.login-back:hover {
  color: var(--crm-primary);
}

@media (max-width: 575.98px) {
  .login-card {
    padding: 28px 22px;
  }
}

.sidebar-backdrop {
  background: rgba(20, 23, 40, .35);
  display: none;
  inset: 0;
  position: fixed;
  z-index: 1030;
}

@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar {
    overflow-x: hidden;
    padding-left: 10px;
    padding-right: 10px;
    width: 72px;
  }

  body.sidebar-collapsed .main {
    margin-left: 72px;
  }

  body.sidebar-collapsed .brand {
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
  }

  body.sidebar-collapsed .brand-name,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .side-link>span {
    display: none;
  }

  body.sidebar-collapsed .side-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 12px 20px;
  }

  .content {
    padding: 25px 20px 40px;
  }
}

@media (max-width: 575.98px) {
  .topbar {
    min-height: 64px;
  }

  .search-box {
    max-width: 190px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .content {
    padding: 22px 14px 32px;
  }

  .page-heading {
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 20px;
  }

  .page-heading .btn {
    padding: 8px 10px;
  }

  .panel-header,
  .panel-body {
    padding: 15px;
  }
}