:root {
  --sidebar-bg: #343a40;
  --sidebar-hover: #494e53;
  --sidebar-text: #c2c7d0;
  --topbar-bg: #ffffff;
  --page-bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dee2e6;
  --text: #212529;
  --muted: #6c757d;
  --primary: #007bff;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --table-head: #343a40;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrapper {
  min-height: 100vh;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 900;
  min-height: 57px;
  margin-left: 250px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  transition: margin-left .2s ease, width .2s ease;
}

.navbar {
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.navbar-nav {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.ml-auto {
  margin-left: auto;
}

.main-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  width: 250px;
  overflow-y: auto;
  background: var(--sidebar-bg);
  transition: transform .2s ease;
}

.elevation-2 {
  box-shadow: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .23);
}

.elevation-3,
.elevation-4 {
  box-shadow: 0 4px 10px rgba(0, 0, 0, .24);
}

.brand-link {
  display: flex;
  align-items: center;
  min-height: 57px;
  padding: .8125rem .5rem;
  color: rgba(255, 255, 255, .8);
  border-bottom: 1px solid #4b545c;
}

.brand-link:hover {
  color: #fff;
}

.brand-image {
  width: 33px;
  height: 33px;
  margin-left: .8rem;
  margin-right: .5rem;
  object-fit: contain;
  opacity: .8;
}

.brand-text {
  font-size: 1.25rem;
  white-space: nowrap;
}

.font-weight-light {
  font-weight: 300;
}

.sidebar {
  padding: 0 .5rem 1rem;
}

.d-flex {
  display: flex;
}

.d-block {
  display: block;
}

.mt-2 {
  margin-top: .5rem;
}

.mt-3 {
  margin-top: 1rem;
}

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

.mb-2 {
  margin-bottom: .5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.pb-3 {
  padding-bottom: 1rem;
}

.user-panel {
  align-items: center;
  border-bottom: 1px solid #4f5962;
}

.user-panel .image {
  padding-left: .8rem;
}

.img-circle {
  border-radius: 50%;
}

.user-panel img {
  width: 34px;
  height: 34px;
  object-fit: cover;
}

.user-panel .info {
  padding: 5px 5px 5px 10px;
  line-height: 1.2;
}

.user-panel .info a {
  max-width: 170px;
  overflow: hidden;
  color: #c2c7d0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-inline {
  margin: .75rem 0;
}

.input-group {
  display: flex;
  width: 100%;
}

.input-group-sm {
  min-height: 31px;
}

.input-group-prepend,
.input-group-append {
  display: flex;
}

.input-group-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: .375rem .75rem;
  color: #495057;
  border: 1px solid #ced4da;
  border-right: 0;
  background: #e9ecef;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: .375rem .75rem;
  color: #495057;
  border: 1px solid #ced4da;
  background: #fff;
}

.form-control-sm,
.input-group-sm .form-control {
  min-height: 31px;
  padding: .25rem .5rem;
  font-size: .875rem;
}

.form-control-sidebar {
  min-height: 38px;
  color: #fff;
  border-color: #56606a;
  background: #3f474e;
}

.form-control-sidebar::placeholder {
  color: #c2c7d0;
}

.btn-sidebar {
  min-width: 42px;
  color: #fff;
  border: 1px solid #56606a;
  background: #3f474e;
}

.nav {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.nav-sidebar .nav-item {
  width: 100%;
}

.nav-sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  margin-bottom: .2rem;
  padding: .5rem 1rem;
  color: var(--sidebar-text);
  border: 0;
  border-radius: .25rem;
  background: transparent;
  text-align: left;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
  color: #fff;
  background: var(--sidebar-hover);
}

.nav-sidebar .nav-icon {
  width: 1.6rem;
  margin-right: .2rem;
  text-align: center;
}

.nav-sidebar p {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.25;
}

.nav-treeview {
  display: none;
  padding-left: 0;
}

.menu-open > .nav-treeview {
  display: block;
}

.nav-treeview .nav-link {
  padding-left: 1rem;
}

.right {
  margin-left: auto;
  transition: transform .2s ease;
}

.menu-open > .demo-tree-toggle .right {
  transform: rotate(-90deg);
}

.content-wrapper {
  min-height: calc(100vh - 57px);
  margin-left: 250px;
  padding-bottom: 24px;
  transition: margin-left .2s ease, width .2s ease;
}

.content-header {
  padding: 15px .5rem;
}

.content-header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 500;
}

.content {
  padding: 0 .5rem;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -7.5px;
  margin-left: -7.5px;
}

[class*="col-"],
[class*="col-sm-"],
[class*="col-md-"] {
  position: relative;
  width: 100%;
  padding-right: 7.5px;
  padding-left: 7.5px;
}

.col,
.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-sm-4,
.col-sm-6,
.col-sm-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.align-items-end {
  align-items: flex-end;
}

.text-right {
  text-align: right;
}

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

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

.float-sm-right {
  float: right;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
  padding: .75rem 1rem;
  list-style: none;
  border-radius: .25rem;
  background: transparent;
}

.breadcrumb-item + .breadcrumb-item::before {
  display: inline-block;
  padding-right: .5rem;
  padding-left: .5rem;
  color: #6c757d;
  content: "/";
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-bottom: 1rem;
  border: 0 solid rgba(0, 0, 0, .125);
  border-radius: .25rem;
  background: var(--surface);
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
}

.card-primary.card-outline,
.card-info.card-outline,
.card-outline {
  border-top: 3px solid var(--primary);
}

.card-header {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, .125);
}

.card-body {
  flex: 1 1 auto;
  min-height: 1px;
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: inline-block;
  margin-bottom: .5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 38px;
  padding: .375rem .75rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  color: #212529;
  background: transparent;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.btn-sm,
.btn-xs {
  min-height: 31px;
  padding: .25rem .5rem;
  font-size: .875rem;
}

.btn-xs {
  min-height: 26px;
  padding: .15rem .4rem;
  font-size: .75rem;
}

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

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

.btn-warning {
  color: #212529;
  background: #ffc107;
}

.info-box {
  display: flex;
  min-height: 90px;
  margin-bottom: 1rem;
  border-radius: .25rem;
  background: #fff;
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
}

.info-box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  color: #fff;
  font-size: 1.875rem;
}

.info-box-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 5px 10px;
}

.info-box-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-box-number {
  display: block;
  font-weight: 700;
}

.bg-info,
.bg-blue {
  background: var(--info);
}

.bg-danger,
.bg-red {
  background: var(--danger);
}

.demo-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 260px;
  overflow: hidden;
}

.demo-chart-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.demo-card-header-primary {
  color: #fff;
  background: var(--primary);
  text-align: center;
}

.demo-card-header-primary h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.demo-dof-card {
  max-width: 320px;
  margin-right: auto;
  margin-left: auto;
}

.demo-dof-card .text-muted {
  margin: 1rem 0 0;
}

.demo-module-note {
  display: none;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.demo-module-note.is-visible {
  display: block;
}

.demo-table-wrap {
  width: 100%;
  max-height: 620px;
  overflow: auto;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  color: #212529;
}

.table th,
.table td {
  padding: .75rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.table-bordered {
  border: 1px solid var(--border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(0, 0, 0, .035);
}

.demo-table {
  min-width: 960px;
  margin-bottom: 0;
  font-size: 12px;
}

.demo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #fff;
  background: var(--table-head);
  white-space: nowrap;
}

.demo-table tbody td,
.demo-table tbody th {
  vertical-align: middle;
  white-space: nowrap;
}

.demo-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.demo-status.is-ok {
  color: var(--success);
  background: #e7f6ee;
}

.demo-status.is-wait {
  color: #856404;
  background: #fff3cd;
}

.demo-status.is-alert {
  color: var(--danger);
  background: #fde8eb;
}

.demo-document-button {
  min-width: 34px;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--success);
}

.demo-action-cell .btn {
  margin-right: 4px;
}

.demo-table-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.demo-loading {
  position: fixed;
  inset: 0;
  z-index: 2040;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(244, 246, 249, .72);
}

.demo-loading.is-visible {
  display: flex;
}

.demo-loading-box {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 190px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

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

.demo-detail-item {
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.demo-detail-label {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.demo-detail-value {
  color: var(--text);
  font-size: 14px;
  word-break: break-word;
}

.demo-document-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f8f9fa;
}

.demo-document-preview i {
  color: var(--primary);
  font-size: 42px;
}

.demo-document-preview.is-photo {
  align-items: flex-start;
}

.demo-photo-preview {
  flex: 0 0 220px;
  width: 220px;
  height: 165px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
}

.demo-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 4px;
  color: #fff;
  background: #343a40;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.demo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 576px) {
  .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .sidebar-collapsed .main-sidebar {
    transform: translateX(-250px);
  }

  .sidebar-collapsed .main-header,
  .sidebar-collapsed .content-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-md-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
  }

  .col-md-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .col-md-auto {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 767.98px) {
  .main-header,
  .content-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-open .main-header,
  .sidebar-open .content-wrapper {
    margin-left: 250px !important;
    width: calc(100% - 250px);
  }

  .main-sidebar {
    transform: translateX(-250px);
  }

  .sidebar-open .main-sidebar {
    transform: translateX(0);
  }

  .content-header .row {
    gap: 8px;
  }

  .breadcrumb {
    justify-content: flex-start;
    padding-left: 0;
  }

  .float-sm-right {
    float: none;
  }

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

  .demo-document-preview.is-photo {
    flex-direction: column;
  }

  .demo-photo-preview {
    flex-basis: auto;
    width: min(100%, 320px);
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media print {
  .main-sidebar,
  .main-header,
  #filterRow {
    display: none;
  }

  .content-wrapper {
    margin: 0;
  }

  .card,
  .info-box {
    box-shadow: none;
  }
}
