:root {
  --surface: #fff;
  --surface-muted: #dedddc;
  --line: #d8d5d3;
  --text: #383433;
  --muted: #817c79;
  --primary: #12a88a;
  --primary-dark: #0d8d74;
  --sidebar: #353332;
  --sidebar-deep: #2c2a29;
  --coral: #f15b50;
  --success: #168c70;
  --danger: #d9534f;
  --warning: #e59a2f;
}

body {
  background: var(--surface-muted);
  color: var(--text);
}

.btn {
  min-height: 36px;
  border-radius: 4px;
  font-size: 0.86rem;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--primary-dark);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
}

.btn-secondary {
  --bs-btn-bg: #5c5755;
  --bs-btn-border-color: #5c5755;
  --bs-btn-hover-bg: #474341;
  --bs-btn-hover-border-color: #474341;
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(18, 168, 138, 0.16);
}

.app-sidebar {
  width: 216px;
  gap: 0;
  padding: 0;
  border-right: 1px solid #292726;
  background: var(--sidebar);
}

.app-content {
  margin-left: 216px;
}

.sidebar-header {
  min-height: 72px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand,
.sidebar-brand:hover,
.sidebar-brand:focus {
  color: #fff;
  font-size: 1.2rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--coral);
}

.sidebar-close {
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #fff;
}

.sidebar-company {
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  background: var(--sidebar-deep);
}

.sidebar-company span,
.sidebar-section {
  color: #8f8a87;
  font-size: 0.68rem;
}

.sidebar-company strong {
  color: #f4f2f1;
  font-size: 0.86rem;
}

.sidebar-nav {
  gap: 0;
  padding: 8px 0 20px;
}

.sidebar-link {
  min-height: 43px;
  gap: 0.7rem;
  padding: 0.62rem 1rem;
  border-left: 3px solid transparent;
  border-radius: 0;
  color: #aaa5a2;
}

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

.sidebar-link.active {
  border-left-color: var(--primary);
}

.sidebar-link.active i {
  color: var(--primary);
}

.sidebar-group-title {
  min-height: 43px;
  padding: 0.65rem 1rem;
  border-radius: 0;
  color: #aaa5a2;
}

.sidebar-group-title:hover,
.sidebar-group-title:focus,
.sidebar-group-title.active {
  background: var(--sidebar-deep);
  color: #fff;
}

.sidebar-group-links {
  gap: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.08);
}

.sidebar-group-links .sidebar-link {
  min-height: 38px;
  padding: 0.5rem 0.75rem 0.5rem 1.7rem;
  font-size: 0.84rem;
}

.topbar {
  background: #f5f4f3;
  border-bottom-color: var(--line);
  backdrop-filter: none;
}

.topbar-inner {
  min-height: 68px;
}

.topbar-title {
  font-size: 1.18rem;
  font-weight: 600;
}

.topbar-search {
  display: flex;
  width: min(280px, 28vw);
  min-height: 36px;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.7rem;
  border: 1px solid #d1cecc;
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  text-align: left;
}

.topbar-search span {
  flex: 1 1 auto;
}

.topbar-search kbd {
  border: 1px solid #ddd9d7;
  background: #f4f2f1;
  color: #77716e;
  font-size: 0.68rem;
}

.topbar-search:hover,
.topbar-search:focus-visible {
  border-color: var(--primary);
  color: var(--primary-dark);
  outline: 0;
}

.user-menu-toggle {
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
  background: #e7e4e2;
}

.user-avatar {
  background: #d8d4d2;
  color: #615c59;
}

.app-main {
  padding-top: 1.25rem;
}

.page-heading h1 {
  font-size: 1.55rem;
  font-weight: 600;
}

.metric-card,
.panel,
.card,
.report-card,
.quick-account {
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05) !important;
}

.card-header {
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-bottom-color: var(--line);
  background: #f8f7f6;
  font-weight: 700;
}

.metric-link:hover,
.metric-link:focus,
.report-card:hover,
.report-card:focus,
.quick-account:hover,
.quick-account:focus {
  border-color: rgba(18, 168, 138, 0.55);
}

.report-card i,
.command-icon {
  border-radius: 4px;
  background: rgba(18, 168, 138, 0.1);
  color: var(--primary);
}

.form-control,
.form-select,
.select2-container--bootstrap-5 .select2-selection {
  min-height: 38px;
  border-color: #d1cecc;
  border-radius: 3px;
}

.form-control:focus,
.form-select:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.15rem rgba(18, 168, 138, 0.14);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f3fbf9;
  margin-bottom: 0;
  color: #4a4542;
  font-size: 0.86rem;
}

.table th {
  height: 46px;
  padding: 0.72rem 1rem;
  border-bottom-width: 1px;
  border-color: #ddd9d7;
  background: #f3f2f1;
  color: #98928e;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: middle;
}

.table td {
  height: 52px;
  padding: 0.72rem 1rem;
  border-color: #e8e5e3;
  background: #fff;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

.table tbody tr:hover td {
  background: var(--bs-table-hover-bg);
}

.table a:not(.btn) {
  color: #3f7870;
  font-weight: 600;
}

.table a:not(.btn):hover,
.table a:not(.btn):focus {
  color: var(--primary-dark);
}

.table-responsive {
  overflow-x: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.card .table-responsive,
.panel .table-responsive {
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

.table .btn-group {
  gap: 0.3rem;
}

.table .btn-group > .btn,
.table td > .btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0.35rem 0.5rem;
  border-color: #d8d4d2;
  border-radius: 4px !important;
  background: #fff;
  color: #6f6966;
}

.table .btn-group > .btn:hover,
.table .btn-group > .btn:focus,
.table td > .btn:hover,
.table td > .btn:focus {
  border-color: var(--primary);
  background: #eff9f6;
  color: var(--primary-dark);
}

.table .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  border-color: #bbb5b2;
  border-radius: 3px;
}

.table .form-check-input:checked {
  border-color: var(--primary);
  background-color: var(--primary);
}

.dataTables_wrapper .dt-search,
.dataTables_wrapper .dt-length {
  margin-bottom: 0.85rem;
}

.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select {
  border-color: #d1cecc;
  border-radius: 3px;
}

.dataTables_wrapper .dt-info,
.dataTables_wrapper .dt-length,
.dataTables_wrapper .dt-search {
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination {
  --bs-pagination-color: #5f5956;
  --bs-pagination-active-bg: var(--primary);
  --bs-pagination-active-border-color: var(--primary);
  --bs-pagination-focus-box-shadow: 0 0 0 0.15rem rgba(18, 168, 138, 0.14);
}

.page-link {
  border-radius: 3px !important;
}

.modal-content {
  border: 1px solid #cbc7c4;
  border-radius: 5px;
  box-shadow: 0 18px 48px rgba(44, 42, 41, 0.24);
}

.modal-header {
  min-height: 58px;
  border-bottom-color: var(--line);
  background: #f8f7f6;
}

.dropdown-menu,
.user-menu-panel,
.finora-fab-menu {
  border-radius: 4px;
}

.finora-fab-main {
  border-radius: 4px;
  background: var(--primary);
  box-shadow: none;
}

.finora-fab-main:hover,
.finora-fab-main:focus-visible {
  background: var(--primary-dark);
}

.finora-fab-menu a:hover,
.finora-fab-menu button:hover,
.command-palette-item:hover,
.command-palette-item.is-active {
  background: #eff9f6;
  color: var(--primary-dark);
}

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

.accounting-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
}

.accounting-guide-item {
  min-width: 0;
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--line);
}

.accounting-guide-item:last-child {
  border-right: 0;
}

.accounting-guide-item strong,
.accounting-guide-item span {
  display: block;
}

.accounting-guide-item span {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.accounting-operation-guide {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--primary);
  background: #eff9f6;
}

.accounting-operation-icon {
  color: var(--primary);
}

.accounting-operation-guide p {
  margin-top: 0.2rem;
  color: #4f565c;
  line-height: 1.45;
}

@media (max-width: 991.98px) {
  .accounting-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounting-guide-item:nth-child(2) {
    border-right: 0;
  }

  .accounting-guide-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 991.98px) {
  .app-content {
    margin-left: 0;
  }

  .app-sidebar {
    width: min(86vw, 280px);
  }
}

@media (max-width: 767.98px) {

  .accounting-guide {
    grid-template-columns: 1fr;
  }

  .accounting-guide-item,
  .accounting-guide-item:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .accounting-guide-item:last-child {
    border-bottom: 0;
  }
  .topbar-inner {
    min-height: 58px;
  }

  .page-heading h1 {
    font-size: 1.35rem;
  }

  .table tr {
    border-radius: 4px;
  }

  .table-responsive,
  .card .table-responsive,
  .panel .table-responsive {
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .table td {
    min-height: 36px;
    height: auto;
    padding: 0.4rem 0;
    background: transparent;
  }

  .table tbody tr:hover td {
    background: transparent;
  }
}
