/* Дивиденды: календарь, карточки компаний, страница компании. Цвета — переменные темы из site.css. */

/* ------------------------------------------------------------------ календарь */
.dcal { padding: 0; }
.dcal__head { padding: 16px 16px 4px; flex-wrap: wrap; }
@media (min-width: 700px) { .dcal__head { padding: 20px 22px 8px; } }
.seg__n { margin-left: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg__btn.is-on .seg__n { color: rgba(255, 255, 255, .75); }
.card__sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }

.dtbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtbl th { font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtbl td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--text); }
.dtbl th:first-child, .dtbl td:first-child { padding-left: 18px; }
.dtbl th:last-child, .dtbl td:last-child { padding-right: 18px; }
.dtbl tbody tr:last-child td { border-bottom: 0; }
.dtbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtbl tr.is-recent td { background: color-mix(in srgb, var(--board) 60%, transparent); }

.dco { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.dco:hover { text-decoration: none; }
.dco:hover b { color: var(--accent-ink); }
.dco b, .dcard__name b { display: block; font-weight: 600; color: var(--ink); line-height: 1.25; }
.dco i, .dcard__name i { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.dps { display: block; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.per { display: block; font-size: 12px; color: var(--muted); }
.c-dates, .h-rec { white-space: nowrap; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.c-dates .buy { display: block; color: var(--muted); }
.c-dates .buy b { color: var(--ink); font-weight: 600; }
.c-dates .rec { display: block; font-size: 12px; color: var(--muted); }
.soon { display: block; font-size: 12px; color: var(--warn); font-weight: 600; }
.h-rec .soon { color: var(--warn); }

.dec { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.src { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--accent-ink); font-size: 13px; font-weight: 500; line-height: 1.3; max-width: 260px; }
.src small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.src__ic { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.src:hover { text-decoration: none; }
.src:hover > span:last-child { text-decoration: underline; }

/* Телефон и планшет: строки таблиц — карточки (таблица целиком помещается только с 1024 px) */
@media (max-width: 1023px) {
	.dtbl thead { display: none; }
	.dtbl, .dtbl tbody, .dtbl tr, .dtbl td { display: block; width: 100%; }
	.dtbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
	.dtbl tbody tr:last-child { border-bottom: 0; }
	.dtbl td, .dtbl td:first-child, .dtbl td:last-child { padding: 0; border: 0; width: auto; }
	.dtbl--cal tr { grid-template-areas: "co dps" "st dates" "src src"; }
	.dtbl--cal .c-co { grid-area: co; min-width: 0; }
	.dtbl--cal .c-dps { grid-area: dps; text-align: right; }
	.dtbl--cal .c-st { grid-area: st; }
	.dtbl--cal .c-dates { grid-area: dates; text-align: right; }
	.dtbl--cal .c-src { grid-area: src; }
	.dtbl--hist tr { grid-template-areas: "per dps" "tk tk" "st rec" "src src"; }
	.dtbl--hist .h-per { grid-area: per; font-weight: 600; color: var(--ink); }
	.dtbl--hist .h-tk { grid-area: tk; font-size: 12.5px; color: var(--muted); }
	.dtbl--hist .h-dps { grid-area: dps; text-align: right; }
	.dtbl--hist .h-st { grid-area: st; }
	.dtbl--hist .h-rec { grid-area: rec; text-align: right; font-size: 12.5px; color: var(--muted); }
	.dtbl--hist .h-rec::before { content: "реестр "; }
	.dtbl--hist .h-rec.is-empty { display: none; }
	.dtbl--hist .h-src { grid-area: src; }
	.dec { display: inline; margin: 0 0 0 6px; }
	.src { max-width: none; }
}

/* ------------------------------------------------------------------ компании: поиск и карточки */
.dfind { flex-direction: row; align-items: center; position: static; }
.dfind .filters__search { flex: 1; }
.dfind .filters__search input { width: 100%; height: 44px; }
.dfind__btn { height: 44px; }
.js .dfind__btn { display: none; }
.dfind__status { min-height: 20px; margin: 8px 4px 10px; color: var(--muted); font-size: 14px; }
.dgrid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .dgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .dgrid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1300px) { .dgrid { grid-template-columns: repeat(4, 1fr); } }
.dcard {
	position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-lg);
	background: var(--card); border: 1px solid rgba(20, 40, 80, .05); box-shadow: var(--shadow); color: var(--text);
	transition: transform .15s, box-shadow .15s;
}
.dcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dcard:hover .dco__av { background: var(--brand); color: #fff; }
.dcard__top { display: flex; align-items: center; gap: 10px; padding-right: 20px; min-width: 0; }
.dcard__name { min-width: 0; }
.dcard__sector { font-size: 12.5px; color: var(--muted); }
.dcard__next { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dcard__next .st { margin-right: 4px; }
.dcard__last { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dcard__last:empty { display: none; }
.dcard__go { position: absolute; right: 14px; top: 16px; width: 16px; height: 16px; color: var(--muted-2); }
.dmore { display: flex; justify-content: center; margin-top: 18px; }
.dmore .btn.is-busy { opacity: .6; pointer-events: none; }

/* ------------------------------------------------------------------ страница компании */
.dkpis { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.dkpis > .kpi--main { grid-column: 1 / -1; }
@media (min-width: 1000px) { .dkpis { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; } .dkpis > .kpi--main { grid-column: auto; } }
.dkpis .kpi--main { overflow: visible; }
.dbuy { margin-top: 4px; color: #fff; }
.dbuy b { font-weight: 600; }
.kpi__val--text { font-size: clamp(22px, 5vw, 28px) !important; }
.dkpis .kpi__sub { line-height: 1.4; }
@media (max-width: 999px) { .dkpis > .kpi:nth-child(4):last-child { grid-column: 1 / -1; } }

.dchart { margin-bottom: 16px; }
.dchart__svg { display: block; width: 100%; height: auto; max-height: 260px; overflow: visible; }
.dchart__s1 { stop-color: var(--g1); }
.dchart__s2 { stop-color: var(--brand-2); }
.dchart__bar { fill: url(#dch-g); }
.dchart__bar.is-part { fill: var(--accent-soft-2); }
.dchart__val { font-size: 13px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.dchart__val.is-zero { fill: var(--muted-2); font-weight: 500; }
.dchart__year { font-size: 12.5px; fill: var(--muted); }
.dchart__axis { stroke: var(--line); stroke-width: 1; }
@media (max-width: 600px) { .dchart__val { font-size: 22px; } .dchart__year { font-size: 20px; } }
.dchart__note { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.dhist { padding: 0; margin-bottom: 16px; }
.dhist .card__head { padding: 18px 18px 6px; margin: 0; flex-wrap: wrap; }
@media (min-width: 700px) { .dhist .card__head { padding: 22px 22px 8px; } }
.dhist .empty { padding: 24px; }

.dpol { display: grid; gap: 10px; margin-bottom: 0; line-height: 1.55; }
.dpol__note { color: var(--muted); }
.dpol__links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 500; }
.dpol__links a { display: inline-flex; align-items: center; gap: 4px; }
.dsame { display: flex; flex-wrap: wrap; gap: 8px; }

.dnote { display: flex; gap: 10px; align-items: flex-start; margin: 26px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dnote .i { margin-top: 2px; color: var(--muted-2); }
.dnote--copy { margin-top: 10px; }

@media print {
	.dfind, .dmore, .js-dtabs, .dnote .i { display: none !important; }
	.dtbl tr[hidden] { display: table-row !important; }
}
