/* ============================
   THEME VARIABLES
   Светлая / тёмная тема через CSS-переменные
============================ */

:root {
    /* Твои существующие переменные — НЕ ТРОГАЮ */
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-topbar: #ffffff;
    --bg-filters: #ffffff;

    --text: #333333;
    --text-soft: #555555;
    --text-muted: #777777;
    --label: #666666;

    --border: #e5e5e5;
    --border-soft: #f0f0f0;

    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-strong: rgba(0, 0, 0, 0.12);
    --shadow-modal: rgba(0, 0, 0, 0.25);

    --btn-secondary-bg: #f0f0f0;
    --btn-secondary-bg-hover: #e0e0e0;
    --btn-primary-bg: #1677ff;
    --btn-primary-bg-hover: #0958d9;
    --btn-primary-fg: #ffffff;

    --table-header-bg: #fafafa;
    --table-row-hover-bg: #f9f9f9;

    --backdrop: rgba(0, 0, 0, 0.35);

    --toast-success: #52c41a;
    --toast-error: #ff4d4f;
    --toast-warning: #faad14;
    --toast-info: #1677ff;
    --toast-fg: #ffffff;
    --toast-warning-fg: #111111;
    --sort-indicator-color: #999999;
    --row-highlight-bg: #fff3b0;
    --child-row-bg: #fafafa;
    --radius-modal: 12px;
    --status-badge-fg: #111111;

    /* ============================
       ДОБАВЛЕННЫЕ ПЕРЕМЕННЫЕ ZIRCONIX
       (ничего не ломают, просто расширяют)
    ============================ */

    /* Фирменные цвета */
    --brand-primary: #3a7afe;
    --brand-accent: #6aa9ff;

    /* Текст */
    --text-strong: #1a1a1a;

    /* Стеклянный топбар */
    --bg-topbar-glass: rgba(255, 255, 255, 0.7);
    --shadow-topbar: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ============================
   DARK THEME OVERRIDES
============================ */

body.dark-theme {
    /* Твои существующие переменные — НЕ ТРОГАЮ */
    --bg: #121212;
    --bg-card: #1c1c1c;
    --bg-topbar: #1f1f1f;
    --bg-filters: #1c1c1c;

    --text: #e5e5e5;
    --text-soft: #cfcfcf;
    --text-muted: #a0a0a0;
    --label: #b0b0b0;

    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.04);

    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --shadow-modal: rgba(0, 0, 0, 0.7);

    --btn-secondary-bg: #2a2a2a;
    --btn-secondary-bg-hover: #333333;
    --btn-primary-bg: #3a7afe;
    --btn-primary-bg-hover: #2d63d1;
    --btn-primary-fg: #ffffff;

    --table-header-bg: #1a1a1a;
    --table-row-hover-bg: #222222;

    --backdrop: rgba(0, 0, 0, 0.55);

    /* Новые переменные Zirconix для тёмной темы */
    --text-strong: #f0f0f0;
    --bg-topbar-glass: rgba(28, 28, 28, 0.7);
    --shadow-topbar: 0 2px 8px rgba(0, 0, 0, 0.4);
    --status-badge-fg: #111111;
    --toast-fg: #ffffff;
    --toast-warning-fg: #111111;
    --sort-indicator-color: #a8a8a8;
    --row-highlight-bg: #4b4230;
    --child-row-bg: #1c1c1c;
    --radius-modal: 12px;
}

/* ============================
   БАЗОВЫЕ СТИЛИ
============================ */

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

/* ============================
   TOPBAR (обновлённый стиль Zirconix)
============================ */

.topbar {
    backdrop-filter: blur(12px);
    background: var(--bg-topbar-glass);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-topbar);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
    color: var(--brand-primary);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
    animation: fadeIn 2.4s ease
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--text-strong);
    font-family: "Inter", "Segoe UI", sans-serif;

    /* Анимация появления */
    animation: fadeIn 2.4s ease;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 8px;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.topbar-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ============================
   КНОПКИ
============================ */

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
}

.btn-primary:hover {
    background: var(--btn-primary-bg-hover);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover);
}

.theme-switch {
    position: relative;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--btn-secondary-bg);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .2s ease, border-color .2s ease;
}

.theme-switch__icon {
    font-size: 12px;
    line-height: 1;
    z-index: 1;
    opacity: .45;
    transform: scale(.92);
    transition: opacity .2s ease, transform .2s ease, color .2s ease;
}

.theme-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}

.theme-switch__icon--sun {
    opacity: 1;
    transform: scale(1);
}

.theme-switch.theme-switch--dark .theme-switch__icon--sun {
    opacity: .45;
    transform: scale(.92);
}

.theme-switch.theme-switch--dark .theme-switch__icon--moon {
    opacity: 1;
    transform: scale(1);
}

.theme-switch.theme-switch--dark .theme-switch__thumb {
    transform: translateX(24px);
}

.theme-switch:active .theme-switch__thumb {
    transform: translateX(1px) scale(.97);
}

.theme-switch.theme-switch--dark:active .theme-switch__thumb {
    transform: translateX(23px) scale(.97);
}

.theme-switch:hover {
    background: var(--btn-secondary-bg-hover);
}

.theme-switch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================
   ФИЛЬТРЫ
============================ */

.filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-filters);
    border-bottom: 1px solid var(--border);
}

.filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item--view {
    margin-left: auto;
}

.filter-item label,
.filter-item-label,
.filters-search-label {
    font-size: 13px;
    color: var(--label);
}

.filters-search-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.filters-search-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-control {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text);
}

/* ============================
   ПЕРЕКЛЮЧАТЕЛЬ ВИДОВ
============================ */

.view-switch {
    display: flex;
    gap: 6px;
}

.switch-btn {
    background: var(--btn-secondary-bg);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background .15s ease, color .15s ease;
    color: var(--text);
}

.switch-btn:hover {
    background: var(--btn-secondary-bg-hover);
}

.switch-btn.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
}

/* ============================
   КОНТЕНТ
============================ */

.content {
    padding: 20px 24px;
}

/* ============================
   АНИМАЦИИ
============================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================
   КАРТОЧКИ ЗАКАЗОВ
============================ */

.cards-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.order-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border);
    transition: transform .15s ease, box-shadow .15s ease;
    animation: fadeInUp .25s ease;
    /* В сетке карточки в строке одной высоты — прижимаем панель действий к низу */
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--shadow-strong);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--status-badge-fg);
    text-transform: capitalize;
}

.order-info {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.45;
    margin-bottom: 12px;
    padding-top: 4px;
}

.order-info div {
    margin-bottom: 4px;
}

/* Блок «Работа» + плашка «Мои работы» на карточке главной страницы */
.order-info > .order-card-work-block {
    margin-bottom: 10px;
}

.order-card-work-block .order-card-work-title {
    margin-bottom: 0;
}

.order-card-my-work-badge-row {
    margin-top: 8px;
    margin-bottom: 4px;
}

.order-card-my-work-badge-row .composite-my-work-badge {
    margin-left: 0;
}

.order-dates {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.order-card-header,
.order-info,
.order-dates,
.order-children {
    flex-shrink: 0;
}

/* Состав в карточках */

.order-children {
    margin-top: 10px;
}

.order-children-content {
    margin-top: 10px;
    animation: fadeInUp .25s ease;
}

.order-card .child-table td,
.order-card .child-table th {
    background: var(--bg-card) !important;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    flex-shrink: 0;
}

.order-actions button {
    border: 1px solid transparent;
    background: var(--btn-secondary-bg);
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
    color: var(--text);
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    line-height: 1;
    font-size: 16px;
}

.order-actions button:hover {
    background: var(--btn-secondary-bg-hover);
    border-color: transparent;
}

.order-actions .primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
}

/* Взять в работу (список заказов сотрудника) */
.table-action-btn.btn-take-work {
    background: rgba(22, 119, 255, 0.12);
    color: var(--btn-primary-bg);
    border: 1px solid rgba(22, 119, 255, 0.35);
}

.table-action-btn.btn-take-work:hover {
    background: rgba(22, 119, 255, 0.2);
}

.order-actions .btn-take-work.primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    border: none;
}

.order-actions .btn-take-work.primary:hover {
    background: var(--btn-primary-bg-hover);
}

.order-actions .primary:hover {
    background: var(--btn-primary-bg-hover);
    border-color: transparent;
}

/* ============================
   ТАБЛИЦА
============================ */

.table-view {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 10px;
    background: var(--table-header-bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    cursor: default;
}

.orders-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.orders-table th.sortable:hover {
    background: var(--btn-secondary-bg-hover);
}

.orders-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    color: var(--text-soft);
}

.orders-table tr:hover td {
    background: var(--table-row-hover-bg);
}

/* Строки с child_orders */

.child-row {
    background: var(--bg-filters);
}

.child-table {
    margin-top: 10px;
    background: var(--bg-card);
    border-radius: 8px;
}

.child-table td,
.child-table th {
    background: var(--bg-card) !important;
}

/* Индикатор сортировки */

.th-sort-asc::after {
    content: " ▲";
    font-size: 12px;
    color: var(--sort-indicator-color);
}

.th-sort-desc::after {
    content: " ▼";
    font-size: 12px;
    color: var(--sort-indicator-color);
}

/* ============================
   МОДАЛКИ (Ant Design style)
============================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-modal);
    padding: 18px 20px;
    width: 420px;
    max-width: 95vw;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-modal);
    animation: fadeInUp .2s ease;
    color: var(--text);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-body {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--label);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.modal-footer .btn {
    min-width: 90px;
}

.modal .form-control,
.modal select {
    width: 100%;
}

/* ============================
   TOAST NOTIFICATIONS
============================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--toast-fg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px var(--shadow-modal);
    animation: toastFadeIn .25s ease;
    opacity: 0.95;
}

.toast-success { background: var(--toast-success); }
.toast-error { background: var(--toast-error); }
.toast-warning { background: var(--toast-warning); color: var(--toast-warning-fg); }
.toast-info { background: var(--toast-info); }

.toast i {
    font-size: 18px;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 0.95; transform: translateY(0); }
}
/* ============================
   АДАПТИВ
============================ */

@media (max-width: 768px) {

    /* Контейнер становится вертикальным */
    .topbar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Верхняя строка: логотип слева, кнопка темы справа */
    .topbar-left {
        width: 100%;
        display: flex;
        justify-content: space-between; /* ← ключ */
        align-items: center;
    }

    /* Кнопка темы — справа, маленькая */
    #themeToggle {
        order: -1; /* ← переносим кнопку темы в верхнюю строку */
        width: 54px;
        height: 30px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        flex: 0 0 auto;
        margin-left: auto; /* ← прижимает к правому краю */
    }

    /* Нижний блок — кнопки заказа и администрирования */
    .topbar-right {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    #addOrderBtn,
    #adminBtn {
        flex: 1 1 auto;
    }
}


/* ============================
   ПОВОРОТ СТРЕЛКИ
============================ */

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    transform: rotate(0deg);
    transition: transform .2s ease;
}

.expand-btn.expanded {
    transform: rotate(90deg);
}

.table-action-btn {
    background: var(--btn-secondary-bg);
    border: 1px solid transparent;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    transition: background .15s ease;
    margin-right: 4px;
    vertical-align: middle;
}

.table-action-btn:hover {
    background: var(--btn-secondary-bg-hover);
}

/* Удаление недоступно — заметно отличается от активной корзины */
.table-action-btn.action-delete--blocked:disabled,
.table-action-btn.action-delete--blocked:disabled:hover,
.table-action-btn.action-assign--blocked:disabled,
.table-action-btn.action-assign--blocked:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    color: var(--text-muted);
    background: var(--btn-secondary-bg);
    border: 1px dashed var(--border);
    box-shadow: none;
}

.order-actions button.action-delete--blocked:disabled,
.order-actions button.action-delete--blocked:disabled:hover,
.order-actions button.action-assign--blocked:disabled,
.order-actions button.action-assign--blocked:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    color: var(--text-muted);
    background: var(--btn-secondary-bg);
    border: 1px dashed var(--border);
    box-shadow: none;
}

body.dark-theme .table-action-btn.action-delete--blocked:disabled,
body.dark-theme .table-action-btn.action-assign--blocked:disabled,
body.dark-theme .order-actions button.action-delete--blocked:disabled,
body.dark-theme .order-actions button.action-assign--blocked:disabled {
    border-color: rgba(255, 255, 255, 0.22);
}

.actions-cell {
    white-space: nowrap;
}

.child-row {
    transition: all .25s ease;
}

.child-row.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.child-row:not(.hidden) {
    opacity: 1;
    max-height: 500px; /* достаточно для вложенной таблицы */
}

@keyframes highlightRow {
    0%   { background-color: var(--row-highlight-bg); }
    100% { background-color: transparent; }
}

.order-row.highlight {
    animation: highlightRow 1.5s ease-out;
}

/* Светлая тема */
.child-row td {
    background: var(--child-row-bg) !important;
}

/* Тёмная тема */
.dark-theme .child-row td {
    background: var(--child-row-bg) !important;
}


/* Контейнер дочерних работ */
.order-children-content {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    overflow-x: hidden;
}

/* Один элемент списка */
.child-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Последний элемент без линии */
.child-item:last-child {
    border-bottom: none;
}

/* Текст */
.child-item div {
    margin: 4px 0;
    line-height: 1.35;
    word-break: break-word;
}

/* Заголовки */
.child-item strong {
    font-weight: 600;
    color: var(--text-strong);
}

.child-item .child-item-actions {
    margin-top: 8px;
    padding-top: 8px;
    justify-content: flex-start;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.25s ease;
}

.status-animated {
    animation: statusPulse 0.35s ease;
}

@keyframes statusPulse {
    0%   { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.order-params-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.modal-backdrop .patient-select-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 0;
}

.modal-backdrop .patient-select-row .order-patient-select {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.modal-backdrop .patient-select-row .order-patient-add-btn {
    margin: 0;
    flex-shrink: 0;
    align-self: center;
    padding: 8px 12px;
    min-width: 44px;
    justify-content: center;
}

.order-create-params {
    margin-bottom: 8px;
}

.order-create-params-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-create-params-fields > label:first-child,
.order-create-params-fields > .order-param-boolean:first-child {
    margin-top: 0;
}

.order-param-boolean {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.order-create-params label {
    margin-top: 8px;
}

/* Экран загрузки до проверки сессии */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
}

.boot-screen.hidden {
    display: none !important;
}

.boot-screen-inner {
    text-align: center;
}

.boot-logo {
    font-size: 2rem;
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.boot-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* QR self-service (цех) */
.scan-intro {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: left;
}

.scan-section {
    margin-bottom: 16px;
}

.scan-section:last-child {
    margin-bottom: 0;
}

.scan-section-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
}

.scan-section--claim .scan-section-title {
    color: var(--btn-primary-bg);
}

.scan-workflow-wrap {
    max-height: min(70vh, 520px);
    overflow: auto;
    text-align: left;
}

.scan-line {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-card);
}

.scan-line-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.scan-line-title {
    font-weight: 600;
    color: var(--text);
}

.scan-line-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.scan-line-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scan-muted {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-scan-claim,
.btn-scan-status {
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--btn-secondary-bg);
    color: var(--text);
    cursor: pointer;
}

.btn-scan-claim {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    border-color: transparent;
}

.btn-scan-claim:hover {
    background: var(--btn-primary-bg-hover);
}

.btn-scan-status:hover:not(:disabled) {
    background: var(--btn-secondary-bg-hover);
}

.btn-scan-status:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .scan-workflow-wrap {
        max-height: min(85vh, 720px);
    }

    .scan-line-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-scan-claim,
    .btn-scan-status {
        width: 100%;
        min-height: 44px;
        font-size: 0.95rem;
        padding: 10px 14px;
    }

    .scan-line {
        padding: 12px 14px;
    }

    .modal-backdrop .modal {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

.composite-my-work-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.12);
    color: var(--btn-primary-bg);
    vertical-align: middle;
}

body.dark-theme .composite-my-work-badge {
    background: rgba(22, 119, 255, 0.22);
    color: #69b1ff;
}

.child-table tbody tr.child-row-assignee {
    background: rgba(22, 119, 255, 0.06);
}

body.dark-theme .child-table tbody tr.child-row-assignee {
    background: rgba(22, 119, 255, 0.12);
}

.child-item-assignee {
    border-left: 3px solid var(--btn-primary-bg);
    padding-left: 10px;
}

