/* Журнал кошелька ДС — табличный вид */

.page-ds { max-width: 1480px; }

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 1px solid #9fc5e8;
}

.sheet-tab {
  border: 1px solid #9fc5e8;
  border-bottom: none;
  background: #eef6fc;
  color: #1f4e79;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.sheet-tab:hover { background: #d6eaf8; }
.sheet-tab.is-active {
  background: #cfe2f3;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 #3d85c6;
}

.sheet-tab.is-recon-ok {
  background: #d9ead3;
  border-color: #6aa84f;
  color: #274e13;
}
.sheet-tab.is-recon-ok:hover { background: #c6e0be; }
.sheet-tab.is-recon-ok.is-active {
  background: #b6d7a8;
  box-shadow: inset 0 -2px 0 #38761d;
}
.sheet-tab.is-recon-ok .tab-bal { color: #38761d; }

.sheet-tab.is-recon-stale {
  background: #fce5cd;
  border-color: #e69138;
  color: #783f04;
}
.sheet-tab.is-recon-stale:hover { background: #f9cb9c; }
.sheet-tab.is-recon-stale.is-active {
  background: #f6b26b;
  box-shadow: inset 0 -2px 0 #b45f06;
}
.sheet-tab.is-recon-stale .tab-bal { color: #b45f06; }

.sheet-tab .tab-bal {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #4b5563;
  font-weight: 400;
}

.sheet-wrap {
  background: #fff;
  border: 1px solid #9fc5e8;
  border-radius: 0 8px 8px 8px;
  padding: 0;
  margin-bottom: 1.25rem;
}

.sheet-toolbar {
  background: #cfe2f3;
  border-bottom: 1px solid #9fc5e8;
  padding: 0.55rem 0.75rem 0.5rem;
}

.sheet-cap-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  align-items: baseline;
  font-size: 0.92rem;
}

.sheet-cap-line .col-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.sheet-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.period-btn {
  border: 1px solid #7ea7cc;
  background: #fff;
  color: #1f4e79;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 4px;
  cursor: pointer;
}

.period-btn:hover { background: #eef6fc; }
.period-btn.is-active {
  background: #3d85c6;
  border-color: #3d85c6;
  color: #fff;
  font-weight: 600;
}

.sheet-scroll {
  max-height: none;
  overflow: visible;
  background: #fff;
}
.sheet-scroll.is-fitted {
  overflow: hidden;
}

.sheet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.sheet-table th,
.sheet-table td {
  border-right: 1px solid #c5d4e3;
  border-bottom: 1px solid #c5d4e3;
  padding: 0.28rem 0.45rem;
  vertical-align: middle;
  background: #fff;
}

.sheet-table th:first-child,
.sheet-table td:first-child {
  border-left: 1px solid #c5d4e3;
}

.sheet-table thead th {
  background: #cfe2f3;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 1px 0 #9fc5e8;
}

.sheet-table .col-num,
.sheet-table td:nth-child(3),
.sheet-table td:nth-child(4),
.sheet-table td:nth-child(5) {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.sheet-table td:nth-child(1) { min-width: 220px; }
.sheet-table td:nth-child(2) { white-space: nowrap; }

.sheet-table tbody tr:nth-child(even) td { background: #f8fbfd; }
.sheet-table tbody tr.op-locked td { color: #6b7280; background: #f3f4f6; }
.sheet-table tbody tr.op-pending td { background: #fffbeb; }
.sheet-table tbody tr.op-plan td { background: #fde8c8; color: #7c2d12; }
.sheet-table tbody tr.op-due td { background: #fcd34d; color: #78350f; }

.sheet-table tfoot td {
  background: #d9ead3;
  font-weight: 600;
  box-shadow: 0 -1px 0 #9fc5e8;
}

.sheet-entry {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.7fr 0.7fr 0.5fr 0.9fr 0.9fr 1.2fr 1fr auto;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid #9fc5e8;
  background: #fffdf5;
  align-items: center;
}

.sheet-entry[hidden],
.sheet-confirm[hidden],
.sheet-wrap.is-readonly .sheet-entry,
.sheet-wrap.is-readonly .sheet-confirm {
  display: none !important;
}

.sheet-entry-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.78rem;
  color: #1f4e79;
}

.sheet-entry.is-copied {
  outline: 2px solid #3d85c6;
  outline-offset: -2px;
}

.sheet-row-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.15rem;
  justify-content: flex-end;
  align-items: center;
}

.btn-copy-op {
  min-width: 1.85rem;
  line-height: 1;
  font-size: 0.95rem;
}

.sheet-entry input,
.sheet-entry select {
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 0.32rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 0;
  width: 100%;
}

.sheet-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #9fc5e8;
  background: #f7fafc;
  font-size: 0.85rem;
}

.sheet-confirm input {
  font-family: var(--font);
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sheet-confirm label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.ds-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0.75rem 0 0;
}

.ds-form input, .ds-form select {
  font-family: var(--font);
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.pending-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.inbox-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.45rem;
}

.confirm-ok { color: #047857; }
.confirm-warn { color: #b45309; }

.op-plan-tag,
.op-due-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: #ea580c;
  color: #fff;
  white-space: nowrap;
}
.op-due-tag {
  background: #b45309;
}

.sheet-repeat {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: #1f4e79;
}
.sheet-repeat select { width: auto; min-width: 12rem; }

.ds-plan-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-start;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #9fc5e8;
  background: #fffdf5;
  font-size: 0.85rem;
}
.ds-plan-tools[hidden] { display: none !important; }
.ds-recurring-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  padding: 0.25rem 0;
}
.tab-bal-plan {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #c2410c;
  font-weight: 400;
}

@media (max-width: 900px) {
  .sheet-entry {
    grid-template-columns: 1fr 1fr;
    position: sticky;
    bottom: 0;
    z-index: 4;
    box-shadow: 0 -8px 18px rgba(31, 78, 121, 0.14);
  }
  /* таблица на мобилке масштабируется до 0,62 — кнопки крупнее, чтобы после scale оставались ~44px */
  .btn-copy-op,
  .btn-del-op {
    min-width: 4.5rem;
    min-height: 4.5rem;
    font-size: 2rem;
    padding: 0.35rem;
  }
}
.sheet-access-note {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid #9fc5e8;
  background: #eef4fa;
  color: #1f4e79;
  font-size: 0.85rem;
  line-height: 1.4;
}

.sheet-access-note[hidden],
.sheet-wrap.is-readonly .sheet-access-note {
  display: none !important;
}



.ds-no-article-list { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.ds-no-article-list .linkish {
  background: none; border: none; padding: 0; color: #1a4f8b; cursor: pointer;
  text-align: left; font: inherit; text-decoration: underline;
}
.op-highlight { outline: 2px solid #e3a008; background: #fff8e6 !important; }
.art-cell .inline-art { max-width: 14rem; }

.ds-confirm-stale {
  margin: 0.65rem 0 0.35rem;
}
.sheet-confirm.is-stale {
  outline: 2px solid #e3a008;
  background: #fff8e6;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
