/*
 * Карточка заказа: лента статусов и просмотр лога обмена с курьерской службой.
 *
 * Правила лежат отдельным файлом, потому что style.css собран из темы и его
 * переписывать нельзя — при следующей сборке правки потеряются. Здесь только
 * то, что относится к карточке заказа.
 */

/* ------------------------------------------------------------------ *
 * Лента статусов
 *
 * Разметка досталась от AdminLTE и рассчитана на узкую колонку. В карточке
 * заказа она растягивается на всю ширину: время уезжает к правому краю, между
 * ним и текстом статуса остаётся пустая полоса в тысячу пикселей. Поэтому
 * ограничиваем ширину ленты и ставим время рядом с текстом.
 * ------------------------------------------------------------------ */

.timeline.timeline--order {
    margin: 0 0 10px;
    max-width: 780px;
}

.timeline.timeline--order > li {
    margin-right: 0;
}

.timeline.timeline--order > li > .timeline-item {
    margin-right: 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 12px;
}

/* Время было float: right — в широкой ленте оно улетало к краю карточки. */
.timeline.timeline--order > li > .timeline-item > .time {
    float: none;
    order: 2;
    margin-left: auto;
    padding: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.timeline.timeline--order > li > .timeline-item > .timeline-header {
    order: 1;
    border-bottom: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.35;
    flex: 1 1 auto;
}

.timeline.timeline--order .tl-lead {
    color: #6c757d;
}

.timeline.timeline--order .tl-status {
    font-weight: 600;
}

.timeline.timeline--order .tl-extra {
    color: #6c757d;
}

.timeline.timeline--order .tl-extra-code {
    font-size: 12px;
    opacity: .75;
}

/* Метка даты стояла левее направляющей и налезала на неё краем. */
.timeline.timeline--order > .time-label {
    margin-bottom: 10px;
}

.timeline.timeline--order > .time-label > span {
    margin-left: 14px;
    padding: 4px 10px;
    font-size: 12px;
    letter-spacing: .02em;
}

/*
 * Кружки-иконки. У AdminLTE `.timeline > li > .fa` (0,2,1) перебивает `.bg-blue`
 * (0,1,0), поэтому все значки выходили одинаково серыми. Добавляем тип к
 * селектору — специфичность становится выше, важность (!important) не нужна.
 */
ul.timeline.timeline--order > li > .bg-blue { background-color: #007bff; }
ul.timeline.timeline--order > li > .bg-green,
ul.timeline.timeline--order > li > .bg-success { background-color: #28a745; }
ul.timeline.timeline--order > li > .bg-red,
ul.timeline.timeline--order > li > .bg-danger { background-color: #dc3545; }
ul.timeline.timeline--order > li > .bg-yellow,
ul.timeline.timeline--order > li > .bg-warning { background-color: #ffc107; color: #212529 !important; }
ul.timeline.timeline--order > li > .bg-gray { background-color: #adb5bd; }

.timeline.timeline--order .tl-empty {
    color: #6c757d;
    font-size: 13px;
    margin-left: 60px;
}

/* ------------------------------------------------------------------ *
 * Лог обмена с курьерской службой
 * ------------------------------------------------------------------ */

.apilog-entry + .apilog-entry {
    margin-top: 10px;
}

.apilog-entry .card-header {
    padding: .5rem .75rem;
}

.apilog-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
}

.apilog-title > a {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}

.apilog-title > a:hover {
    text-decoration: none;
}

.apilog-title .apilog-caret {
    transition: transform .15s ease;
}

.apilog-title > a:not(.collapsed) .apilog-caret {
    transform: rotate(90deg);
}

.apilog-when {
    font-variant-numeric: tabular-nums;
    color: #6c757d;
    font-size: 12px;
}

.apilog-method {
    font-weight: 600;
}

.apilog-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.apilog-pane-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.apilog-pane-title {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6c757d;
}

.apilog-kind {
    font-size: 10px;
    line-height: 1;
    letter-spacing: .06em;
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid #ced4da;
    color: #495057;
    background: #f1f3f5;
}

.apilog-copy {
    margin-left: auto;
    border: 0;
    background: none;
    padding: 2px 6px;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    border-radius: 3px;
}

.apilog-copy:hover {
    background: #e9ecef;
    color: #212529;
}

.apilog-copy.is-done {
    color: #28a745;
}

pre.apilog-code {
    margin: 0;
    max-height: 420px;
    overflow: auto;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .25rem;
    font-size: 12px;
    line-height: 1.5;
    tab-size: 2;
    white-space: pre;
    color: #24292e;
}

pre.apilog-code code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: inherit;
}

/* Палитра подсветки. Светлая тема. */
.apilog-code .t-key      { color: #005cc5; }
.apilog-code .t-str      { color: #032f62; }
.apilog-code .t-num      { color: #b31d28; }
.apilog-code .t-bool     { color: #6f42c1; font-weight: 600; }
.apilog-code .t-null     { color: #6f42c1; font-style: italic; }
.apilog-code .t-punct    { color: #7a8087; }
.apilog-code .t-tag      { color: #22863a; font-weight: 600; }
.apilog-code .t-attr     { color: #6f42c1; }
.apilog-code .t-attrval  { color: #032f62; }
.apilog-code .t-comment  { color: #7a8087; font-style: italic; }
.apilog-code .t-decl     { color: #7a8087; }
.apilog-code .t-cdata    { color: #b31d28; }

/* ------------------------------------------------------------------ *
 * История переотправок в другую курьерскую службу
 * ------------------------------------------------------------------ */

.resend-log {
    max-width: 900px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #e4e9ee;
    border-left: 3px solid #b07b1e;
    border-radius: 4px;
    background: #fdfaf3;
}

.resend-log__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #8a6116;
}

.resend-log__table { margin-bottom: 6px; font-size: .84rem; }
.resend-log__table th { font-weight: 600; color: #6c757d; }
.resend-log__when,
.resend-log__num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.resend-log__note {
    margin: 0;
    font-size: .76rem;
    line-height: 1.35;
    color: #7a6432;
}

/* Что решили про товар на прежнем складе. Цвет несёт смысл: незакрытый
   случай (компенсация не создалась) должен быть виден, не читая строку. */
.resend-log__stock { white-space: nowrap; }

.resend-log__mark {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: .74rem;
    line-height: 1.5;
    white-space: nowrap;
}

.resend-log__mark.is-kept    { background: #e6f4ea; color: #1e7a3c; }
.resend-log__mark.is-shipped { background: #fdf1dd; color: #8a5a12; }
.resend-log__mark.is-failed  { background: #fdeaea; color: #a12626; }
.resend-log__mark.is-none    { background: #eef1f4; color: #6c757d; }

.resend-log__auto {
    display: inline-block;
    margin-left: 5px;
    font-size: .72rem;
    color: #8a7b52;
}

/* ------------------------------------------------------------------ *
 * Вопрос о товаре на прежнем складе (окно переотправки)
 * ------------------------------------------------------------------ */

.resent-stock {
    padding: 9px 11px;
    border: 1px solid #f0d9a8;
    border-left: 3px solid #d99e28;
    border-radius: 4px;
    background: #fdf8ee;
}

.resent-stock__options .form-check { margin-bottom: 3px; }
.resent-stock__options .form-check:last-child { margin-bottom: 0; }
.resent-stock__options .form-check-label { font-weight: 600; }

.resent-stock__hint,
.resent-stock__auto {
    margin: 7px 0 0;
    font-size: .76rem;
    line-height: 1.4;
    color: #7a6432;
}

.resent-stock__auto { margin-top: 0; }

/* Разделитель колонок в карточке. Раньше стоял прямо в разметке двумя разными
   светло-серыми — тёмная тема их перекрыть не могла, и линия светилась. */
.card-col-divider { border-right: 1px solid #eef1f4; }

@media (max-width: 767px) {
    .card-col-divider { border-right: 0; }
}

/* Разделители внутри таблиц остатков и карточек заявок.
 *
 * Раньше их задавали инлайном (#f4f4f4 и #777), а инлайн бьёт правила темы —
 * в тёмной получалась ярко-белая линия поперёк тёмной страницы. Цвет берётся
 * из переменных темы, поэтому обе темы получают свой. */
[data-divider="col"] { border-right: 1px solid #f4f4f4; }
[data-divider="left"] { border-left: 3px double #777; }
[data-divider="top"] { border-top: 3px double #777; }
