/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */

/* ---- Animated tesseract logo: a real 4D hypercube drawn on a canvas
   (Ui::Tesseract) that rotates in 4D on hover, like the Wikipedia gif. ---- */
.navbar-brand.brand-animated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.brand-tesseract {
  display: block;
}
.brand-wordmark {
  display: inline-block;
  height: 40px;
  width: 172px;
  background: url("/images/logo/logo2-white.png") no-repeat;
  background-size: 207px 40px;
  background-position: -36px center;
}

/* ---- Notes::Editor (native Tiptap notes editor — replaces Froala) ---- */
.notes-editor {
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
}
.notes-editor--disabled {
  background: #f7f7f7;
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  border-radius: 3px 3px 0 0;
}
.notes-toolbar__btn {
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1;
  color: #333;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
}
.notes-toolbar__btn:hover:not(:disabled) {
  background: #eee;
}
.notes-toolbar__btn.is-active {
  background: #e0e7ef;
  border-color: #c3cdda;
}
.notes-toolbar__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.notes-toolbar__sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: #ddd;
}

.notes-editor__surface .ProseMirror {
  min-height: 140px;
  padding: 8px 10px;
  outline: none;
}
.notes-editor__surface .ProseMirror p {
  margin: 0 0 0.5em;
}
.notes-editor__surface .ProseMirror:focus {
  outline: none;
}
/* Placeholder-free empty state still needs a clickable area. */
.notes-editor__surface .ProseMirror > *:last-child {
  margin-bottom: 0;
}

/* ---- Native select2-markup combobox (Ui::Select2) ---- */
/* Reuses the theme's .select2-* styling; only positions the inline dropdown
   (the real select2 appended it to <body> and positioned it with JS). */
.select2-container--inline {
  position: relative;
  display: block;
  width: 100%;
}
.select2-container--inline .select2-selection--single {
  cursor: pointer;
}
.select2-dropdown-inline {
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  z-index: 1051;
}
.select2-dropdown-inline .select2-dropdown {
  position: static;
  width: 100% !important;
}

/* ---- Native inline-editable field (replaces jQuery x-editable) ---- */
.ui-editable {
  color: inherit;
  border-bottom: 1px dashed #0088cc;
  text-decoration: none;
  cursor: pointer;
}
.ui-editable:hover,
.ui-editable:focus {
  color: #0088cc;
  border-bottom-color: #0088cc;
  text-decoration: none;
}
.ui-editable--empty {
  font-style: italic;
  color: #d35400;
  border-bottom-color: #d35400;
}
.ui-editable__input {
  display: inline-block;
  width: auto;
  min-width: 120px;
  max-width: 100%;
  vertical-align: middle;
}

/* ---- Native block overlay (replaces jQuery blockUI) ---- */
.ui-block-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: wait;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px #ddd;
  color: #333;
}
.ui-block-overlay--dark {
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px #000;
  color: #fff;
}
.ui-block-overlay .spinner {
  display: inline-block;
  animation: ui-spin 1s linear infinite;
}
@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Native notifications (replaces jQuery PNotify) ---- */
.ui-notify-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100040;
  width: 300px;
  max-width: calc(100vw - 40px);
}
.ui-notify {
  position: relative;
  margin-bottom: 10px;
  padding: 12px 15px;
  border-radius: 3px;
  color: #fff;
  background: #555;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0.95;
  animation: ui-notify-in 0.25s ease;
}
.ui-notify:hover {
  opacity: 1;
}
.ui-notify-success {
  background: #4caf50;
}
.ui-notify-error {
  background: #ef5350;
}
.ui-notify-warning {
  background: #ff9800;
}
.ui-notify-info {
  background: #2196f3;
}
.ui-notify__title {
  font-weight: 600;
  margin-bottom: 4px;
}
.ui-notify__text ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
@keyframes ui-notify-in {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 0.95;
  }
}
.ui-notify-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.ui-notify-confirm {
  margin-top: 80px;
  width: 340px;
  max-width: calc(100vw - 40px);
  padding: 16px 18px;
  border-radius: 3px;
  background: #fff;
  color: #333;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  border-top: 4px solid #ff9800;
}
.ui-notify-confirm .ui-notify__title {
  color: #333;
}
.ui-notify-confirm__buttons {
  margin-top: 14px;
  text-align: right;
}
.ui-notify-confirm__buttons .btn {
  margin-left: 6px;
}

/* ---- Native progress bar (Ui::ProgressBar) ---- */
.progress-bar {
  transition: width 0.6s ease;
}

/* ---- Native fade carousel (Ui::SlickView) ---- */
.ui-carousel {
  position: relative;
}
.ui-carousel__track {
  position: relative;
}
.ui-carousel .slide {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.5s ease;
}
.ui-carousel .slide.is-active {
  opacity: 1;
  visibility: visible;
  position: relative;
}
.ui-carousel__dots {
  text-align: center;
  padding: 12px 0 0;
}
.ui-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: #ccc;
  margin: 0 4px;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ui-carousel__dot.is-active {
  background: #2196f3;
}
.ui-carousel__arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #555;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ui-carousel__arrow:hover {
  background: rgba(0, 0, 0, 0.12);
}
.ui-carousel__arrow--prev {
  left: -6px;
}
.ui-carousel__arrow--next {
  right: -6px;
}

/* ---- Native SVG chart (Ui::Chart) ---- */
.ui-chart {
  position: relative;
}
.ui-chart__svg {
  width: 100%;
  height: auto;
  display: block;
}
.ui-chart__grid {
  stroke: #eee;
  stroke-width: 1;
}
.ui-chart__ylabel {
  font-size: 10px;
  fill: #999;
  text-anchor: end;
  transform: translateX(-8px);
}
.ui-chart__xlabel {
  font-size: 10px;
  fill: #777;
}
.ui-chart__ylabel--right {
  text-anchor: start;
  transform: none;
}
.ui-chart__bar {
  transition: opacity 0.15s ease;
}
.ui-chart__line {
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ui-chart__hit {
  fill: transparent;
}
.ui-chart__hit:hover {
  fill: rgba(0, 0, 0, 0.03);
}
.ui-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  padding: 8px 0 2px;
  font-size: 12px;
  color: #555;
}
.ui-chart__legend-item {
  display: inline-flex;
  align-items: center;
}
.ui-chart__swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  margin-right: 5px;
}
.ui-chart__tooltip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: rgba(40, 40, 40, 0.92);
  color: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.ui-chart__tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.ui-chart__tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ui-chart__tooltip-name {
  flex: 1;
}
.ui-chart__tooltip-value {
  font-weight: 600;
}
.chart-year-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.chart-year-tab {
  padding: 3px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  color: #555;
}
.chart-year-tab.is-active {
  background: #2196f3;
  border-color: #2196f3;
  color: #fff;
}

/* Sidebar nav scrolls natively now that nicescroll is gone (only shows a
   scrollbar when the menu overflows). */
.sidebar .menu-list {
  overflow-y: auto;
}

/* ---- Native styled checkbox (Ui::CheckBox) ---- */
.ui-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.ui-checkbox--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ui-checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ui-checkbox__box {
  width: 18px;
  height: 18px;
  border: 2px solid #bbb;
  border-radius: 3px;
  background: #fff;
  display: inline-block;
  position: relative;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.ui-checkbox__input:checked + .ui-checkbox__box {
  background: #2196f3;
  border-color: #2196f3;
}
.ui-checkbox__input:checked + .ui-checkbox__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ui-checkbox__input:focus + .ui-checkbox__box {
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* ---- Native toggle switch (Ui::UiSwitchery) ---- */
.switchery {
  display: inline-block;
  cursor: pointer;
  vertical-align: middle;
}
.switchery--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.switchery__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switchery__track {
  display: inline-block;
  width: 46px;
  height: 24px;
  background: #dfdfdf;
  border-radius: 24px;
  transition: background 0.2s ease;
  position: relative;
  vertical-align: middle;
}
.switchery__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: left 0.2s ease;
}
.switchery__input:checked + .switchery__track {
  background: #2196f3;
}
.switchery__input:checked + .switchery__track .switchery__knob {
  left: 24px;
}

/* ---- Native date picker (Ui::DatePicker) ---- */
/* Reuses the theme's .datepicker table styling; just positions the popup that
   the old jQuery plugin appended to <body> and placed with JS. */
.date-picker-wrap {
  position: relative;
}
.datepicker-inline-pop {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1051;
  margin-top: 2px;
  display: block;
  min-width: 17em;
  padding: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.datepicker-inline-pop table {
  width: 100%;
  margin: 0;
}
.datepicker-inline-pop td,
.datepicker-inline-pop th {
  text-align: center;
  padding: 5px 6px;
  cursor: pointer;
  border-radius: 3px;
}
.datepicker-inline-pop th.dow {
  cursor: default;
  color: #999;
  font-weight: 600;
}
.datepicker-inline-pop td.day:hover,
.datepicker-inline-pop tfoot th:hover,
.datepicker-inline-pop th.prev:hover,
.datepicker-inline-pop th.next:hover {
  background: #eee;
}
.datepicker-inline-pop td.day.old,
.datepicker-inline-pop td.day.new {
  color: #bbb;
}
.datepicker-inline-pop td.day.today {
  background: #fdf5d9;
}
.datepicker-inline-pop td.day.active,
.datepicker-inline-pop td.day.active:hover {
  background: #2196f3;
  color: #fff;
}
.datepicker-inline-pop .datepicker-switch {
  cursor: default;
  font-weight: 600;
}

/* ---- Native date-range picker (Ui::DateRangePicker) ---- */
.date-range-wrap {
  position: relative;
}
.daterange-pop {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1051;
  margin-top: 2px;
  display: flex;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.daterange-presets {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  min-width: 130px;
  border-right: 1px solid #eee;
  background: #fafafa;
}
.daterange-preset {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: #333;
}
.daterange-preset:hover {
  background: #e0e7ef;
}
.daterange-cals {
  display: flex;
}
.daterange-cal {
  padding: 8px;
}
.daterange-cal + .daterange-cal {
  border-left: 1px solid #eee;
}
.daterange-cal table {
  margin: 0;
}
.daterange-cal td,
.daterange-cal th {
  text-align: center;
  padding: 5px 7px;
  border-radius: 3px;
}
.daterange-cal td.day {
  cursor: pointer;
}
.daterange-cal th.dow {
  color: #999;
  font-weight: 600;
}
.daterange-cal th.prev,
.daterange-cal th.next {
  cursor: pointer;
}
.daterange-cal .datepicker-switch {
  font-weight: 600;
}
.daterange-cal td.day:hover {
  background: #eee;
}
.daterange-cal td.day.old,
.daterange-cal td.day.new {
  color: #bbb;
}
.daterange-cal td.day.in-range {
  background: #e0e7ef;
}
.daterange-cal td.day.active,
.daterange-cal td.day.active:hover {
  background: #2196f3;
  color: #fff;
}
.daterange-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #eee;
}
.daterange-current {
  flex: 1;
  font-size: 12px;
  color: #555;
}
.daterange-body {
  display: flex;
  flex-direction: column;
}

/* ---- Fund Structure (AntV X6) diagram canvas ---- */
.x6-structure-canvas {
  width: 100%;
  height: 600px;
  border: 1px solid #ddd;
}

.notes-content {
  word-wrap: break-word;
}
.notes-content p {
  margin: 0 0 0.5em;
}

/* ---- Anchored popup (driven by app/utils/popup.js) ---- */
.app-popup {
  display: none;
  position: fixed;
  z-index: 1900;
  background: #fff;
  border: 1px solid #d4d4d5;
  border-radius: 4px;
  padding: 0.833em 1em;
  line-height: 1.4285em;
  color: rgb(0 0 0 / 87%);
  box-shadow:
    0 2px 4px 0 rgb(34 36 38 / 12%),
    0 2px 10px 0 rgb(34 36 38 / 8%);
}

/* ---- Home index feature screenshots ---- */
.screenshot {
  float: left;
  width: 450px;
  max-width: 100%;
  height: auto;
  margin: 0 1em 1em 0;
}

/* ---- Report list cards (home/reports/index) ---- */
.report-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 4px;
  box-shadow:
    0 1px 3px 0 #d4d4d5,
    0 0 0 1px #d4d4d5;
  color: inherit;
  transition:
    box-shadow 0.1s ease,
    transform 0.1s ease;
}

.report-card:hover,
.report-card:focus {
  color: inherit;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow:
    0 2px 6px 0 #bcbdbd,
    0 0 0 1px #d4d4d5;
}

.report-card-content {
  flex: 1;
  padding: 1em;
}

.report-card-header {
  display: block;
  font-weight: 700;
  font-size: 1.1em;
  color: rgb(0 0 0 / 85%);
}

.report-card-meta {
  font-size: 0.9em;
  color: rgb(0 0 0 / 40%);
  margin-bottom: 0.5em;
}

.report-card-description {
  color: rgb(0 0 0 / 68%);
}

.report-card-extra {
  padding: 0.75em 1em;
  border-top: 1px solid rgb(0 0 0 / 5%);
  color: rgb(0 0 0 / 40%);
}

.report-card-extra::after {
  content: "";
  display: table;
  clear: both;
}

/* ---- Report parameters dropdown (home/reports/report) ---- */
.report-params-dropdown {
  width: 500px;
  padding: 15px;
}

/* Account tree (chart-of-accounts page) */
.account-tree__item {
  display: block;
  padding: 3px 6px;
  color: inherit;
  border-radius: 3px;
}

.account-tree__item:hover {
  background: #f5f5f5;
  text-decoration: none;
}

.account-tree__item--active {
  background: #e0e7ef;
}
