@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Varta:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #5d80b6;
  --primary-50: #ecf0f6;
  --primary-100: #ced9e9;
  --primary-200: #aec0db;
  --primary-700: #4b6da6;
  --primary-900: #30508e;
  --secondary: #b8b4b2;
  --secondary-50: #f6f6f6;
  --secondary-100: #eae9e8;
  --secondary-200: #dcdad9;
  --body-color: #4b4b4b;
  --body-dark: #000000;
  --danger: #ea5455;
  --warning: #ffa958;
  --success: #28c76f;
  --white: #ffffff;
  --border: #e0e0e0;
  --font-base: "Varta", sans-serif;
  --font-headings: "Montserrat", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--body-color) !important;
  background: var(--white);
  font-family: var(--font-base);
  font-weight: 300 !important;
  letter-spacing: 0;
}

body.app-body {
  padding-top: 72px;
}

body.bodysections {
  display: flex;
  min-height: 100vh !important;
  padding-top: 0;
}

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

button,
input {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  margin-top: 0;
  color: var(--body-dark);
  font-family: var(--font-headings);
  font-weight: 600 !important;
}

p {
  margin-top: 0;
}

strong {
  font-weight: 700 !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-white {
  background-color: var(--white) !important;
}

.bg-gray {
  background-color: var(--secondary-50) !important;
}

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

.text-muted {
  color: rgba(75, 75, 75, 0.65) !important;
}

.shadow-0 {
  box-shadow: none !important;
}

.small {
  font-size: 0.875rem;
}

.tit-main {
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.tit-section {
  margin: 0 0 16px;
  padding-bottom: 0.25rem;
  font-size: 1rem;
}

.tit-section.border-bottom {
  border-bottom: 3px solid var(--border) !important;
}

.section-kicker {
  margin: 0 0 0.5rem;
  color: rgba(75, 75, 75, 0.65);
  font-family: var(--font-headings);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.container-fluid {
  width: 100%;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
  margin-right: auto;
  margin-left: auto;
}

.container-1440 {
  max-width: none !important;
}

/* Login */
.bg-section {
  flex: 60%;
  min-height: 100vh;
  color: rgba(255, 255, 255, 0.5);
  background-color: var(--primary);
  background-image: url("../img/bg_circles_white.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.white-section {
  flex: 40%;
  min-height: 100vh;
  padding-right: 100px;
  background-color: var(--white);
}

.login-icon {
  display: inline-flex;
  width: 10rem;
  height: 10rem;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-headings);
  font-size: 4.4rem;
  font-weight: 300;
}

.brand-logo {
  display: block;
  width: 100px;
  max-width: 100%;
  height: auto;
}

.login-panel {
  width: min(100%, 360px);
}

/* Layout */
#topnavbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1040 !important;
  height: 56px;
  color: var(--white);
}

.navbar {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.navbar .container-fluid {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-width: max-content;
  color: var(--white);
}

.navbar-brand-title {
  color: var(--white);
  font-family: var(--font-headings);
  font-size: 0.92rem;
  font-weight: 600;
}

.menu-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: default;
  font-size: 1.35rem;
}

img.brand {
  height: 16px;
}

#mainmenu {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-headings) !important;
  font-size: 0.875rem;
  font-weight: 600;
}

.navbar-nav {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 0.25rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.2;
}

.nav-dropdown-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.nav-dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-left: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 13rem;
  padding: 0.4rem;
  margin: 0;
  border: 1px solid rgba(48, 80, 142, 0.12);
  border-radius: 0.35rem;
  background: var(--white);
  box-shadow: 0 10px 32px rgba(48, 80, 142, 0.18);
  list-style: none;
}

.nav-item:hover .nav-dropdown-menu,
.nav-item:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-link {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 0.25rem;
  color: var(--body-color);
  line-height: 1.2;
  white-space: nowrap;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.active {
  background: var(--primary-50);
  color: var(--primary-900);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.user-menu form {
  margin: 0;
}

#content {
  position: relative;
  z-index: 800;
  margin: 16px 0 0;
  padding-bottom: 80px;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-intro p {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-family: var(--font-headings);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn-primary {
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--primary-700);
  background-color: var(--primary-700);
  color: var(--white);
}

.btn-outline-primary {
  border-color: var(--primary);
  background-color: var(--white) !important;
  color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary-50) !important;
  color: var(--primary-900);
}

.btn-topbar {
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.72);
  background: transparent;
  color: var(--white);
  font-size: 0.78rem;
}

.btn-topbar:hover,
.btn-topbar:focus {
  border-color: var(--white);
  background: var(--white);
  color: var(--primary);
}

.btn-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-base);
  font-weight: 300;
}

/* Forms */
.stacked-form,
.login-form {
  display: block;
}

.form-outline {
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--body-color);
  font-size: 0.875rem;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 36px !important;
  padding: 0.375rem 0.75rem;
  border: 1px solid #bdbdbd;
  border-radius: 0.25rem;
  background-color: var(--white);
  color: var(--body-color);
  font-family: var(--font-base);
  font-size: 14px !important;
  font-weight: 300;
  line-height: 1.5;
}

.form-control:focus {
  border-color: var(--primary) !important;
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--primary) !important;
}

.alert {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-danger {
  border-color: rgba(234, 84, 85, 0.18);
  background-color: rgba(234, 84, 85, 0.12);
  color: var(--danger);
}

.alert-warning {
  border-color: rgba(255, 169, 88, 0.24);
  background-color: rgba(255, 169, 88, 0.14);
  color: #8a4b12;
}

.alert-light {
  border-color: var(--border);
  background-color: var(--white);
  color: var(--body-color);
}

.message-stack {
  margin-bottom: 1rem;
}

/* Tables */
.table-container {
  width: 100%;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.table-search {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  align-items: flex-end;
  gap: 0.75rem;
  overflow-x: auto;
}

.table-search-label {
  margin-bottom: 0;
}

.table-filter-fields {
  display: grid;
  flex: 1 1 520px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.table-filter-field {
  min-width: 0;
}

.table-filter-fields .form-control {
  min-width: 0;
}

.table-search-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.table-search-controls .form-control {
  min-width: 260px;
}

.table-search-clear {
  min-height: 36px;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  color: var(--body-color);
  vertical-align: top;
}

.table > thead {
  vertical-align: top !important;
}

.table th {
  padding: 8px 0.5em !important;
  background-color: var(--primary-50) !important;
  color: var(--body-color);
  font-size: 12px;
  font-weight: 600;
  line-height: 14px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table th a {
  color: var(--body-color);
}

.table th.orderable {
  padding-left: 1rem !important;
  cursor: pointer;
}

.table td {
  padding: 0.2rem 0.5em !important;
  border-bottom: 1px solid #f0f0f0;
  color: var(--body-color) !important;
  font-size: 0.875rem !important;
  vertical-align: middle;
  white-space: nowrap;
}

.table tr:hover td {
  background-color: #fbfbfb;
}

.table td.btn-actions,
.table .table-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.text-end {
  text-align: right !important;
}

.row-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 0.55rem;
  color: var(--primary);
  font-family: var(--font-headings);
  font-size: 0.78rem;
  font-weight: 600;
}

.row-action:hover {
  background-color: var(--primary-50);
}

.empty-table-cell {
  padding: 1rem !important;
  white-space: normal !important;
}

.empty-table-cell .alert {
  margin-bottom: 0;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 1em;
  padding: 3px 10px;
  background-color: var(--primary-50);
  color: var(--primary) !important;
  font-size: 0.78rem;
  font-weight: 400;
  white-space: nowrap;
}

.badge.bg-primary {
  background-color: var(--primary) !important;
  color: var(--white) !important;
}

.pagination {
  display: flex;
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.page-item {
  display: flex;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.pagination-circle .page-numbers,
.pagination-circle .rounded-pill {
  display: flex;
  margin: auto 8px;
  border-radius: 24px;
  background-color: #f3f2f7;
}

.pagination-circle .page-item .page-link {
  min-width: 34px;
  border: 0;
  border-radius: 24px;
  background-color: #f3f2f7;
  color: var(--primary);
  text-align: center;
}

.pagination-circle .page-item.active .page-link {
  background-color: var(--primary);
  color: var(--white);
}

.pagination-circle .page-link {
  display: block;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
}

/* Detail pages */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1rem;
}

.detail-grid-full {
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--secondary-200);
  border-radius: 0.25rem;
  background-color: var(--white);
  background-clip: border-box;
}

.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--secondary-200);
  background-color: var(--secondary-100);
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.definition-list div {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.definition-list dt {
  margin-bottom: 0.25rem;
  color: rgba(75, 75, 75, 0.7);
  font-family: var(--font-headings);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.definition-list dd {
  margin: 0;
  color: var(--body-color);
  overflow-wrap: anywhere;
}

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

.detail-field-groups {
  display: grid;
  gap: 1rem;
}

.detail-field-group {
  min-width: 0;
}

.detail-group-title {
  margin: 0 0 0.5rem;
  color: var(--secondary-800);
  font-family: var(--font-headings);
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-field-group .definition-list {
  border-top: 1px solid #f0f0f0;
}

.detail-stock-table {
  margin-bottom: 0;
}

.detail-related-table {
  min-width: 760px;
  margin-bottom: 0;
}

.detail-lines {
  margin-top: 1rem;
}

.detail-lines .table {
  margin-bottom: 0;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.text-center {
  text-align: center !important;
}

.text-start {
  text-align: left !important;
}

.w-100 {
  width: 100% !important;
}

.m-0 {
  margin: 0 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.pt-2 {
  padding-top: 0.5rem !important;
}

.ps-4 {
  padding-left: 1.5rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

@media (max-width: 900px) {
  body.bodysections {
    display: block;
  }

  .bg-section {
    min-height: 34vh;
  }

  .white-section {
    min-height: auto;
    padding: 2rem 1.5rem !important;
  }

  body.app-body {
    padding-top: 0;
  }

  #topnavbar {
    position: static;
    height: auto;
  }

  .navbar .container-fluid,
  #mainmenu,
  .navbar-nav,
  .user-menu,
  .page-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .navbar-nav {
    width: 100%;
  }

  .nav-link {
    padding-left: 0;
  }

  .nav-dropdown-menu {
    position: static;
    display: block;
    min-width: 0;
    padding: 0 0 0 0.75rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-dropdown-link {
    color: rgba(255, 255, 255, 0.78);
  }

  .nav-dropdown-link:hover,
  .nav-dropdown-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
  }

  .container-fluid {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .detail-grid,
  .definition-list,
  .definition-list-full {
    grid-template-columns: 1fr;
  }

  .table-search,
  .table-actions,
  .table-filter-fields,
  .table-search-controls {
    width: 100%;
  }

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

  .table-search {
    align-items: flex-end;
    flex-direction: row;
  }

  .table-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .table-search-controls {
    width: auto;
    align-items: center;
    flex-direction: row;
  }

  .table-filter-fields {
    min-width: 520px;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .table-search-controls .form-control {
    min-width: 0;
  }
}
