:root {
  /* Brand colors */
  --nexus-primary:        #875A7B;
  --nexus-primary-dark:   #6d4862;   /* hover */
  --nexus-primary-light:  #a17496;   /* accents */

  /* Functional status colors */
  --nexus-success: #28a745;  /* Completed, Won, Online */
  --nexus-warning: #ffc107;  /* Pending, Late, Attention */
  --nexus-danger:  #dc3545;  /* Error, Delete, Overdue */
  --nexus-info:    #17a2b8;  /* Status, Information */

  /* Neutrals */
  --nexus-bg:        #f8f9fa; /* App background */
  --nexus-card:      #ffffff;
  --nexus-text:      #212529;
  --nexus-text-muted:#6c757d;
  --nexus-border:    #dee2e6;

  /* Bootstrap 5 overrides */
  --bs-primary:     var(--nexus-primary);
  --bs-primary-rgb: 135, 90, 123;
  --bs-body-bg:     var(--nexus-bg);
  --bs-body-color:  var(--nexus-text);
  --bs-link-color:  var(--nexus-primary);
  --bs-link-hover-color: var(--nexus-primary-dark);
}

/* Custom Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.nx-page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--nexus-text);
}

.nx-label-muted {
  font-size: 13px;
  color: var(--nexus-text-muted);
}

/* Buttons */
.btn-nx-primary {
  background-color: var(--nexus-primary);
  border-color: var(--nexus-primary);
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.btn-nx-primary:hover, .btn-nx-primary:focus {
  background-color: var(--nexus-primary-dark);
  border-color: var(--nexus-primary-dark);
  color: #fff;
}

.btn-nx-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(135, 90, 123, 0.5);
}

.btn-nx-secondary {
  background-color: #fff;
  border: 1px solid var(--nexus-border);
  color: #495057;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.btn-nx-secondary:hover {
  background-color: var(--nexus-bg);
  color: var(--nexus-text);
  border-color: var(--nexus-border);
}

/* Navigation & Navbar */
.nx-navbar {
  background-color: var(--nexus-primary) !important;
  border-bottom: 2px solid var(--nexus-primary-dark);
}

.nx-navbar .navbar-brand,
.nx-navbar .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
}

.nx-navbar .nav-link:hover,
.nx-navbar .nav-link.active {
  color: #fff !important;
}

.nx-navbar .dropdown-menu {
  border-radius: 6px;
  border: 1px solid var(--nexus-border);
}

/* Breadcrumbs */
.nx-breadcrumb {
  background-color: #e9ecef;
  padding: 8px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--nexus-border);
}

.nx-breadcrumb a {
  text-decoration: none;
  color: var(--nexus-primary);
}

.nx-breadcrumb a:hover {
  text-decoration: underline;
}

/* Page Header */
.nx-page-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--nexus-border);
  padding: 12px 24px;
}

/* Filters */
.nx-filter-bar {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Avatars */
.nx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background-color: var(--nexus-primary);
  font-weight: bold;
  user-select: none;
}

.nx-avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.nx-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.nx-avatar-stack > .nx-avatar {
  margin-left: -8px;
  border: 2px solid #fff;
}

.nx-avatar-stack > .nx-avatar:first-child {
  margin-left: 0;
}

/* CRUD Inline elements & table hover states */
.user-row {
  transition: background-color 0.15s ease-in-out;
}

.user-row:hover {
  background-color: rgba(135, 90, 123, 0.05) !important;
}

.edit-field {
  max-width: 180px;
  border: 1px solid transparent;
  background-color: transparent;
  transition: all 0.15s ease-in-out;
}

.user-row:hover .edit-field,
.edit-field:focus {
  border-color: var(--nexus-border);
  background-color: #ffffff;
}

.edit-field:focus {
  outline: 2px solid var(--nexus-primary-light);
  outline-offset: 1px;
  box-shadow: 0 0 0 0.2rem rgba(135, 90, 123, 0.25);
}

.btn-action {
  padding: .2rem .5rem;
  font-size: .8rem;
}

.password-input {
  max-width: 160px;
  font-size: .85rem;
}

/* Generic Inline Edit Trigger Class */
.inline-edit-trigger {
  border-bottom: 1px dashed var(--nexus-primary-light);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.15s;
  display: inline-block;
}

.inline-edit-trigger:hover,
.inline-edit-trigger:focus {
  background-color: rgba(135, 90, 123, 0.1);
  outline: none;
}

/* Custom Form Switches */
.form-check-input:checked {
  background-color: var(--nexus-primary);
  border-color: var(--nexus-primary);
}
