:root {
  --valu-ink: #17232d;
  --valu-ink-soft: #223442;
  --valu-canvas: #f5f7f5;
  --valu-paper: #ffffff;
  --valu-line: #dfe7e4;
  --valu-muted: #718087;
  --valu-teal: #0f766e;
  --valu-teal-dark: #0b5f59;
  --valu-coral: #e76f51;
  --valu-shadow: 0 10px 30px rgba(23, 35, 45, 0.07);
}

html,
body {
  min-width: 320px;
}

body.valusys-shell {
  background-color: var(--valu-canvas);
  color: var(--valu-ink);
  font-family: "Source Sans Pro", sans-serif;
  background-image: linear-gradient(135deg, rgba(15, 118, 110, 0.035) 25%, transparent 25%), linear-gradient(315deg, rgba(231, 111, 81, 0.025) 25%, transparent 25%);
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
}

body.valusys-auth {
  background-color: var(--valu-ink);
  background-image: linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(23, 35, 45, 0.98)), repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 14px);
}

.valusys-auth .login-box {
  width: min(380px, calc(100% - 2rem));
}

.valusys-auth .login-box .card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.valusys-auth .login-box .card-header {
  background: var(--valu-ink);
  border-bottom: 0;
  padding: 1.5rem 1.25rem;
}

.valusys-auth .login-box .card-header a {
  color: #fff;
  font-size: 1.5rem;
}

.valusys-auth .login-box .card-header a::before {
  background: var(--valu-teal);
  border-radius: 7px;
  content: "V";
  display: inline-flex;
  font-size: 1rem;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin-right: 0.45rem;
  vertical-align: 0.12rem;
  width: 32px;
}

.valusys-auth .login-box .card-header a b {
  font-weight: 700;
}

.valusys-auth .login-box .card-header a {
  font-size: 0;
}

.valusys-auth .login-box .card-header a b {
  font-size: 1.5rem;
}

.valusys-auth .login-box .card-body {
  padding: 1.5rem;
}

.valusys-auth .login-box-msg {
  color: var(--valu-muted);
  padding-bottom: 1.2rem;
}

.valusys-shell .main-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--valu-line);
  box-shadow: 0 2px 12px rgba(23, 35, 45, 0.04);
  backdrop-filter: blur(12px);
}

.valusys-shell .main-header .nav-link {
  color: var(--valu-ink-soft);
  transition: background-color 160ms ease, color 160ms ease;
}

.valusys-shell .main-header .nav-link:hover,
.valusys-shell .main-header .nav-link:focus {
  background: #edf5f3;
  color: var(--valu-teal);
}

.valusys-shell .main-sidebar,
.valusys-shell .main-sidebar::before {
  background: var(--valu-ink);
}

.valusys-shell .main-sidebar {
  box-shadow: 8px 0 28px rgba(23, 35, 45, 0.12) !important;
}

.valusys-shell .brand-link {
  background: var(--valu-ink) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #fff !important;
  font-size: 1.25rem;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.1rem;
}

.valusys-shell .brand-link::before {
  background: var(--valu-teal);
  border-radius: 7px;
  content: "V";
  display: inline-flex;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-right: 0.6rem;
  width: 30px;
}

.valusys-shell .user-panel {
  border-bottom-color: rgba(255, 255, 255, 0.11) !important;
  padding-bottom: 1rem;
}

.valusys-shell .user-panel .info a {
  color: #eef6f4 !important;
  font-weight: 600;
}

.valusys-shell .user-panel .info::after {
  color: #91aaa6;
  content: "Signed in workspace";
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.valusys-shell .form-control-sidebar {
  background: var(--valu-ink-soft) !important;
  border: 1px solid #38505d !important;
  border-radius: 8px 0 0 8px;
}

.valusys-shell .btn-sidebar {
  background: var(--valu-ink-soft) !important;
  border: 1px solid #38505d !important;
  border-left: 0 !important;
  border-radius: 0 8px 8px 0;
  color: #a9c2bd !important;
}

.valusys-shell .nav-sidebar .nav-link {
  border-radius: 8px;
  color: #b8c8c6;
  margin: 0.18rem 0;
  padding: 0.7rem 0.8rem;
}

.valusys-shell .nav-sidebar .nav-link:hover,
.valusys-shell .nav-sidebar .nav-link:focus,
.valusys-shell .nav-sidebar .nav-link.active {
  background: #29434b !important;
  color: #fff !important;
}

.valusys-shell .nav-sidebar .nav-link.active {
  box-shadow: inset 3px 0 var(--valu-coral);
}

.valusys-shell .nav-sidebar .nav-treeview .nav-link.active {
  background: rgba(15, 118, 110, 0.38) !important;
  box-shadow: none;
}

.valusys-shell .role-permission-grid {
  display: grid;
  gap: 0.55rem 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.valusys-shell .role-permission-section {
  background: #f8fbfa;
  border: 1px solid var(--valu-line);
  border-radius: 7px;
  margin-top: 0.75rem;
  padding: 0.7rem;
}

.valusys-shell .role-permission-section h6 {
  color: var(--valu-teal-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.valusys-shell .role-permission-grid .custom-control-label {
  color: var(--valu-ink-soft);
  font-size: 0.82rem;
  line-height: 1.25;
}

.valusys-shell .role-editor {
  border: 1px solid var(--valu-line);
  border-radius: 7px;
  padding: 0.65rem 0.75rem;
}

.valusys-shell .role-editor + .role-editor {
  margin-top: 0.5rem;
}

.valusys-shell .role-editor summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.valusys-shell .role-editor summary::-webkit-details-marker {
  display: none;
}

.valusys-shell .role-editor summary::after {
  color: var(--valu-muted);
  content: "\\f078";
  font-family: "Font Awesome 6 Free";
  font-size: 0.7rem;
  font-weight: 900;
  margin-left: 0.5rem;
  transition: transform 180ms ease;
}

.valusys-shell .role-editor[open] summary::after {
  transform: rotate(180deg);
}

.valusys-shell .role-editor summary span:first-child {
  min-width: 0;
}

.valusys-shell .role-editor summary strong,
.valusys-shell .role-editor summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.valusys-shell .role-editor summary small {
  color: var(--valu-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.valusys-shell .role-editor-body {
  border-top: 1px solid var(--valu-line);
  margin-top: 0.65rem;
  padding-top: 0.7rem;
}

.valusys-shell .nav-sidebar .nav-icon {
  color: #8db5ae;
}

.valusys-shell .user-panel .info small {
  color: #91aaa6 !important;
  display: block;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.valusys-shell .main-header .navbar-nav .dropdown-item-text {
  min-width: 180px;
  padding: 0.5rem 1rem;
}

.valusys-shell .content-wrapper {
  background: transparent;
  padding-bottom: 1.5rem;
}

.valusys-shell .content-header {
  padding: 1.5rem 1.25rem 0.8rem;
}

.valusys-shell .content-header h1,
.valusys-shell .content-header h2,
.valusys-shell .content-header h3 {
  color: var(--valu-ink);
  font-weight: 700;
}

.valusys-shell .content {
  padding: 0 1.25rem;
}

.valusys-shell .card,
.valusys-shell .info-box,
.valusys-shell .small-box {
  border: 1px solid var(--valu-line);
  border-radius: 10px;
  box-shadow: var(--valu-shadow);
}

.valusys-shell .card {
  overflow: hidden;
}

.valusys-shell .table-card,
.valusys-shell .table-card .card-body,
.valusys-shell .table-card .dataTables_wrapper {
  overflow: visible;
}

.valusys-shell .table-card {
  position: relative;
  z-index: 2;
}

.valusys-shell .table-card.is-loading::after {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  color: var(--valu-teal-dark);
  content: "Loading...";
  display: flex;
  font-size: 0.9rem;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  letter-spacing: 0.03em;
  position: absolute;
  z-index: 1100;
}

.valusys-shell .table-card.is-loading::before {
  animation: valusys-loading 900ms linear infinite;
  border: 3px solid #d7e6e2;
  border-radius: 50%;
  border-top-color: var(--valu-teal);
  content: "";
  height: 26px;
  left: 50%;
  margin: -2.1rem 0 0 -13px;
  position: absolute;
  top: 50%;
  width: 26px;
  z-index: 1101;
}

@keyframes valusys-loading {
  to { transform: rotate(360deg); }
}

.valusys-shell .card-header {
  background: var(--valu-paper);
  border-bottom: 1px solid var(--valu-line);
  padding: 1rem 1.2rem;
}

.valusys-shell .card-title {
  color: var(--valu-ink);
  font-weight: 700;
}

.valusys-shell .card-body {
  padding: 1.2rem;
}

.valusys-shell .info-box {
  min-height: 96px;
  padding: 0.65rem;
}

.valusys-shell .info-box .info-box-icon {
  border-radius: 8px;
  width: 62px;
}

.valusys-shell .info-box .info-box-number {
  color: var(--valu-ink);
  font-size: 1.45rem;
}

.valusys-shell .info-box .info-box-text {
  color: var(--valu-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.valusys-shell .btn {
  border-radius: 7px;
  font-weight: 600;
}

.valusys-shell .btn-primary {
  background: var(--valu-teal);
  border-color: var(--valu-teal);
}

.valusys-shell .btn-primary:hover,
.valusys-shell .btn-primary:focus {
  background: var(--valu-teal-dark);
  border-color: var(--valu-teal-dark);
}

.valusys-shell .form-control,
.valusys-shell .custom-select,
.valusys-shell .select2-container--default .select2-selection--single {
  border-color: #ccd9d5;
  border-radius: 7px;
  min-height: 40px;
}

.valusys-shell .form-control:focus,
.valusys-shell .custom-select:focus {
  border-color: var(--valu-teal);
  box-shadow: 0 0 0 0.16rem rgba(15, 118, 110, 0.14);
}

.valusys-shell .table {
  color: var(--valu-ink);
}

.valusys-shell .table thead th {
  background: #f0f5f3;
  border-bottom: 1px solid var(--valu-line);
  color: #52656b;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.valusys-shell .table td,
.valusys-shell .table th {
  border-top-color: #e9efed;
  vertical-align: middle;
}

.valusys-shell .table tbody tr:hover {
  background: #f8fbfa;
}

.valusys-shell .table {
  width: 100% !important;
}

.valusys-shell .table th,
.valusys-shell .table td {
  vertical-align: middle;
}

.valusys-shell .table th:last-child,
.valusys-shell .table td:last-child {
  min-width: 138px;
  text-align: center;
  width: 138px;
}

.valusys-shell .table-actions {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 128px;
  position: relative;
}

.valusys-shell .table-action-toggle {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  justify-content: center;
  min-width: 110px;
}

.valusys-shell .table-action-toggle i {
  transition: transform 180ms ease;
}

.valusys-shell .table-actions.is-open .table-action-toggle i {
  transform: rotate(180deg);
}

.valusys-shell .table-actions.is-open .table-action-toggle {
  background: var(--valu-coral);
  border-color: var(--valu-coral);
}

.valusys-shell .table-actions.is-open .table-action-toggle:hover,
.valusys-shell .table-actions.is-open .table-action-toggle:focus {
  background: #d95d42;
  border-color: #d95d42;
}

.valusys-shell .table-action-menu {
  align-items: center;
  background: var(--valu-paper);
  border: 1px solid var(--valu-line);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(23, 35, 45, 0.18);
  display: flex;
  height: 180px;
  justify-content: center;
  max-width: calc(100vw - 2rem);
  min-width: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  transform: translateY(-0.35rem) scale(0.98);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 180ms ease;
  width: 180px;
  z-index: 1050;
}

.valusys-shell .table-actions.is-open .table-action-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.valusys-shell .table-action-menu .btn {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-size: 0;
  height: 34px;
  margin: 0 !important;
  justify-content: center;
  padding: 0;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px;
}

.valusys-shell .table-action-menu .btn i {
  font-size: 0.9rem;
}

.valusys-shell .table-action-menu .table-action-close {
  background: var(--valu-ink);
  border-color: var(--valu-ink);
  left: 50%;
  top: 50%;
}

.valusys-shell .table-action-menu .btn:nth-of-type(2) { left: 50%; top: 22%; }
.valusys-shell .table-action-menu .btn:nth-of-type(3) { left: 72%; top: 30%; }
.valusys-shell .table-action-menu .btn:nth-of-type(4) { left: 78%; top: 50%; }
.valusys-shell .table-action-menu .btn:nth-of-type(5) { left: 72%; top: 70%; }
.valusys-shell .table-action-menu .btn:nth-of-type(6) { left: 50%; top: 78%; }
.valusys-shell .table-action-menu .btn:nth-of-type(7) { left: 28%; top: 70%; }
.valusys-shell .table-action-menu .btn:nth-of-type(8) { left: 22%; top: 50%; }
.valusys-shell .table-action-menu .btn:nth-of-type(9) { left: 28%; top: 30%; }

.valusys-shell .table-action-menu .table-action-close i {
  font-size: 0.85rem;
}

.valusys-shell .main-footer {
  background: rgba(255, 255, 255, 0.84);
  border-top-color: var(--valu-line);
  color: var(--valu-muted);
}

.valusys-shell .modal-content {
  border: 1px solid var(--valu-line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(23, 35, 45, 0.2);
}

@media (max-width: 767.98px) {
  .valusys-shell .content-header {
    padding: 1.1rem 0.8rem 0.5rem;
  }

  .valusys-shell .content {
    padding: 0 0.8rem;
  }

  .valusys-shell .content-header h1 {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .valusys-shell .breadcrumb {
    font-size: 0.78rem;
    margin-top: 0.35rem;
  }

  .valusys-shell .card-body {
    padding: 0.9rem;
  }

  .valusys-shell .card-header {
    padding: 0.85rem 0.9rem;
  }

  .valusys-shell .info-box {
    margin-bottom: 0.7rem;
  }

  .valusys-shell .row > [class*="col-"] {
    margin-bottom: 0.15rem;
  }

  .valusys-shell .table-responsive,
  .valusys-shell .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .valusys-shell .table-card .dataTables_wrapper {
    overflow-x: auto;
    overflow-y: visible;
  }

  .valusys-shell .table {
    min-width: 620px;
  }

  .valusys-shell .table-actions {
    min-width: 128px;
  }

  .valusys-shell .table-action-menu {
    height: 170px;
    width: 170px;
  }

  .valusys-shell .role-permission-grid {
    grid-template-columns: 1fr;
  }

  .valusys-shell .modal-dialog {
    margin: 0.6rem;
  }

  .valusys-shell .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .valusys-shell .modal-footer .btn {
    margin: 0.2rem 0;
    width: 100%;
  }

  .valusys-shell .main-footer {
    font-size: 0.78rem;
    padding: 0.8rem;
  }
}

@media (max-width: 420px) {
  .valusys-auth .login-box .card-body {
    padding: 1.15rem;
  }

  .valusys-auth .login-box .row > .col-8,
  .valusys-auth .login-box .row > .col-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .valusys-auth .login-box .row > .col-4 {
    margin-top: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .valusys-shell *,
  .valusys-shell *::before,
  .valusys-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
