
.otb-main {
  display: flex;
  flex-direction: column;
}

.otb-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 15px 15px;
}

.otb-status-switch {
  display: flex;
  gap: 8px;
}

.otb-budget-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin: 15px;
  align-items: stretch;
}

.otb-budget-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;

  cursor: pointer;
  transition: all 0.3s ease;
}

.otb-budget-card.inactive {
  opacity: 0.6;
}

.otb-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.otb-card-head h3 {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.otb-card-meta,
.otb-card-description {
  font-size: 0.86rem;
  line-height: 1.4;
}

.otb-card-description {
  margin: 0;
  border-radius: 10px;
  padding: 0px 10px;
}

.otb-card-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;

  padding: 5px;

  border-radius: 10px;
}

.otb-card-values > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.otb-card-values span {
  font-size: 0.82rem;
}

.otb-card-values strong {
  font-size: 0.9rem;
  text-align: right;
}

.otb-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  padding-top: 8px;

  border-top: 1px solid;

  font-size: 0.82rem;
}

.otb-empty,
.otb-empty-small {
  padding: 18px;

  border: 1px dashed;
  border-radius: 12px;

  text-align: center;
}

.otb-row-2,
.otb-row-3 {
  display: flex;
  gap: 10px;
}

.otb-row-2 > .otb-field:first-child {
  flex: 2;
}

.otb-row-2 > .otb-field:last-child {
  flex: 1;
}

.otb-row-3 > .otb-field {
  flex: 1;
}

.otb-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 14px;

  border: 1px solid;
  border-radius: 16px;
}

.otb-field {
  min-width: 0;
}

.otb-field label {
  display: block;

  margin: 0 0 6px 2px;

  font-size: 0.78rem;
  font-weight: 700;
}

.otb-field input,
.otb-field select,
.otb-field textarea {
  box-sizing: border-box;
  width: 100%;
}

.otb-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.otb-summary-box {
  height: fit-content;
  padding: 12px;

  border: 1px solid;
  border-radius: 12px;

  text-align: center;
}

.otb-summary-box-header {
  display: block;

  margin-bottom: 6px;

  font-size: 0.8rem;
}

.otb-summary-box-hvalue {
  font-weight: 600;
}

.otb-summary-box-label {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;

  font-size: 12px;
}

.otb-summary-box-lvalue {
  font-weight: 600;
}

.otb-detail-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 5px 0;
}

.otb-items-section {
  margin-top: 12px;
}

.otb-item-panel {
  display: none;
  margin-bottom: 10px;
  max-height: 55vh;
  overflow: auto;
  padding: 3px;
}

.otb-item-panel.active {
  display: block;
}

.otb-items-section h3 {
  margin: 0 0 10px;
}

.otb-items-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.otb-item-row {
  display: flex;
  flex-direction: column;
  gap: 8px;

  min-width: 0;
  padding: 10px;

  border: 1px solid;
  border-radius: 12px;

  cursor: pointer;
  transition: all 0.3s ease;
}

.otb-item-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;

  min-width: 0;
}

.otb-item-line-head {
  font-size: 0.9rem;
}

.otb-item-line-amounts {
  font-size: 0.86rem;
}

.otb-item-name {
  min-width: 0;
  overflow: hidden;

  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otb-item-date {
  flex-shrink: 0;

  font-size: 0.78rem;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.otb-item-planned {
  min-width: 0;
}

.otb-item-planned strong {
  font-size: 0.9rem;
}

.otb-item-linked {
  flex-shrink: 0;

  font-size: 0.78rem;
  font-style: italic;
  text-align: right;
  white-space: nowrap;
}

.otb-item-linked strong {
  font-style: normal;
}

.otb-item-description {
  box-sizing: border-box;
  width: 100%;
  padding: 2px 10px;

  border-radius: 10px;

  font-size: 12px;
  overflow-wrap: anywhere;
}

.otb-item-description.hidden {
  display: none;
}

.otb-item-row:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.otb-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;

  min-width: 0;
}

.otb-item-meta {
  padding-left: 5px;

  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.otb-item-amount {
  display: flex;
  flex-direction: column;
  gap: 3px;

  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.otb-item-amount-linked {
  font-size: 12px;
  font-style: italic;
}

.otb-transactions-modal {
  width: min(900px, calc(100vw - 24px));
  max-width: 900px;
}

.otb-transaction-toolbar {
  margin-bottom: 10px;
}

.otb-transactions-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 3px;
  max-height: 55vh;
  overflow: auto;
}

@media (max-width: 930px) {
.otb-transactions-list {
  grid-template-columns: 1fr 1fr;
}}

@media (max-width: 640px) {
.otb-transactions-list {
  grid-template-columns: 1fr;
}}

.otb-transaction-row {
  display: flex;
  flex-direction: column;
  gap: 7px;

  padding: 10px;

  border: 1px solid;
  border-radius: 12px;

  cursor: pointer;
}

.otb-transaction-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: space-between;
}

.otb-transaction-line-title {
  justify-content: flex-start;
}

.otb-transaction-line-info {
  justify-content: flex-start;
}

.otb-transaction-line-amount {
  align-items: center;
}

.otb-link-check {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.otb-transaction-title {
  min-width: 0;
  overflow: hidden;

  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otb-transaction-meta {
  min-width: 0;
  overflow: hidden;

  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otb-transaction-original {
  font-weight: 700;
  white-space: nowrap;
}

.otb-transaction-recalculated {
  font-weight: 400;
  font-size: 14px;
}

.otb-allocated-input {
  width: min(180px, 100%) !important;
  margin: 0 !important;
  padding: 5px 10px;
}

/* Původní třída ponechaná kvůli kompatibilitě */

.otb-transaction-info {
  display: flex;
  flex-direction: column;

  min-width: 0;
}

.otb-transaction-info small {
  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.otb-account-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;

  padding: 8px;
  margin-bottom: 5px;

  border: 1px solid;
  border-radius: 12px;
}

.otb-account-option {
  display: flex;
  align-items: center;
  gap: 6px;

  margin: 0;
  opacity: 0.65;
}

.otb-account-option.active {
  opacity: 1;
}

.otb-account-option small {
  font-size: 0.75rem;
  font-weight: 400;
}

@media (max-width: 700px) {
  .otb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .otb-status-switch > * {
    flex: 1;
  }

  .otb-row-2 > .otb-field:first-child,
  .otb-row-2 > .otb-field:last-child,
  .otb-row-3 > .otb-field {
    flex: auto;
  }

  .otb-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .otb-detail-actions {
    align-items: stretch;
  }

  .otb-detail-actions-switch {
    flex: 1;
  }

  .otb-item-name {
    white-space: normal;
  }

  .otb-transaction-title,
  .otb-transaction-meta {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 500px) {
  .otb-detail-actions {
    flex-direction: column;
  }

  .otb-detail-actions-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .otb-detail-actions > #addItemBtn {
    width: 100%;
  }

  .otb-item-line {
    gap: 8px;
  }

  .otb-item-line-amounts {
    align-items: flex-start;
  }

  .otb-item-date,
  .otb-item-linked {
    text-align: right;
  }

}

@media (max-width: 430px) {

  .otb-item-line-head,
  .otb-item-line-amounts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Přepínače v detailu souhrn/položky a napojení transakce */

.otb-detail-view-switch,
.otb-detail-actions-switch,
.otb-transaction-view-switch{text-align: center;}

.otb-detail-view-panel {display: none;}
.otb-detail-view-panel.active {display: block;}

