.voditka-page {
    padding: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.voditka-panel {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    background: var(--neutral-layer-1);
    padding: 12px;
}

.voditka-vydej-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.voditka-vydej-page > .form-section-title,
.voditka-vydej-page > .voditka-panel,
.voditka-vydej-page > fluent-message-bar {
    width: 100%;
    max-width: 100%;
}

.voditka-vydej-page .voditka-package-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
}

.voditka-vydej-page .voditka-package {
    justify-content: space-between;
    width: 100%;
}

.voditka-vydej-page .swipe-action-row,
.voditka-vydej-page fluent-message-bar {
    width: 100%;
}

.voditka-baliky-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.voditka-baliky-page > .form-section-title,
.voditka-baliky-page > .voditka-panel,
.voditka-baliky-page > fluent-message-bar {
    width: 100%;
    max-width: 100%;
}

.voditka-baliky-detail-page > .voditka-panel,
.voditka-baliky-detail-page > fluent-message-bar {
    width: 100%;
    max-width: 100%;
}

.voditka-baliky-order-row {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.voditka-baliky-order-row:focus-visible {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: 2px;
}

.voditka-package-detail-list {
    display: flex;
    flex-direction: column;
}

.voditka-baliky-page .voditka-load-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.voditka-baliky-labels-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.voditka-baliky-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(62dvh, calc(100dvh - 250px));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-width: thin;
}

.voditka-baliky-order-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    min-width: 0;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 8px;
    background: var(--neutral-fill-rest);
}

.voditka-baliky-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.voditka-baliky-order-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.voditka-baliky-order-main strong {
    overflow-wrap: anywhere;
}

.voditka-baliky-order-main span,
.voditka-baliky-order-progress span {
    color: var(--neutral-foreground-hint);
    font-size: 0.78rem;
}

.voditka-baliky-order-progress {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.voditka-baliky-type-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
}

.voditka-baliky-type-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 6px;
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-hint);
    font-weight: 800;
}

.voditka-baliky-label-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.voditka-baliky-loose-item-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    align-items: stretch;
}

.voditka-baliky-loose-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 8px;
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
}

.voditka-baliky-loose-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.voditka-baliky-loose-main strong,
.voditka-baliky-loose-main span {
    overflow-wrap: anywhere;
}

.voditka-baliky-loose-main span,
.voditka-baliky-loose-quantity span {
    color: var(--neutral-foreground-hint);
    font-size: 0.72rem;
}

.voditka-baliky-loose-quantity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.voditka-baliky-loose-controls {
    display: grid;
    grid-template-columns: 40px minmax(62px, auto) 40px;
    gap: 6px;
    align-items: center;
    justify-content: end;
}

.voditka-baliky-loose-item.empty {
    border-color: #e5e7eb;
    background: #fff;
    color: #111827;
}

.voditka-baliky-loose-item.incomplete {
    border-color: #86efac;
    background: #dcfce7;
    color: #14532d;
}

.voditka-baliky-loose-item.complete {
    border-color: #14532d;
    background: #166534;
    color: #fff;
    --neutral-foreground-rest: #fff;
    --neutral-fill-stealth-hover: #15803d;
    --neutral-fill-stealth-active: #14532d;
}

.voditka-baliky-loose-item.over-limit {
    border-color: #f97316;
    background: #ffedd5;
    color: #9a3412;
}

.voditka-baliky-loose-item .voditka-baliky-loose-main span,
.voditka-baliky-loose-item .voditka-baliky-loose-quantity span {
    color: inherit;
}

.voditka-baliky-loose-item.flash {
    animation: voditka-loose-item-flash 0.5s ease-out;
}

@keyframes voditka-loose-item-flash {
    0%, 70% { box-shadow: 0 0 0 3px currentColor; }
    100% { box-shadow: none; }
}

.voditka-baliky-label-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 68px;
    min-height: 38px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 6px 8px;
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
}

.voditka-baliky-label-chip span {
    color: var(--neutral-foreground-hint);
    font-size: 0.72rem;
    font-weight: 700;
}

.voditka-baliky-label-chip.loaded {
    border-color: #16a34a;
    background: #dcfce7;
    color: #14532d;
}

.voditka-baliky-label-chip.loaded span {
    color: #166534;
}

.voditka-baliky-label-chip:disabled {
    opacity: 1;
}

.voditka-baliky-label-chip.flash {
    animation: voditka-package-loaded-flash 0.5s ease-out;
}

@keyframes voditka-package-loaded-flash {
    0%,
    70% {
        border-color: #15803d;
        background: #86efac;
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
    }

    100% {
        border-color: #16a34a;
        background: #dcfce7;
        box-shadow: none;
    }
}

.voditka-scan-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voditka-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--neutral-foreground-hint);
    text-transform: uppercase;
}

.voditka-scan-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.voditka-scanner-input {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    height: 44px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    padding: 0 10px;
    background: var(--neutral-fill-input-rest);
    color: var(--neutral-foreground-rest);
    font-size: 1rem;
    box-sizing: border-box;
}

.voditka-zebra-scanner {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.voditka-zebra-scanner .zebra-scanner-input__input {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    height: 44px;
}

.voditka-zebra-scanner fluent-button {
    min-height: 44px;
}

.voditka-scan-line fluent-button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
}

.voditka-order-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.voditka-order-summary div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voditka-order-summary span,
.voditka-muted {
    color: var(--neutral-foreground-hint);
    font-size: 0.82rem;
}

.voditka-order-summary strong {
    font-size: 1rem;
}

.voditka-load-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.voditka-load-summary div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voditka-load-summary span {
    color: var(--neutral-foreground-hint);
    font-size: 0.82rem;
}

.voditka-load-summary strong {
    font-size: 1rem;
}

.voditka-package-progress-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.voditka-package-progress-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 4px 8px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    background: var(--neutral-fill-secondary-rest);
    color: var(--neutral-foreground-rest);
}

.voditka-package-progress-chip span {
    color: var(--neutral-foreground-hint);
    font-weight: 800;
}

.voditka-package-progress-chip.complete {
    border-color: #16a34a;
    background: #dcfce7;
    color: #14532d;
}

.voditka-package-progress-chip.complete span {
    color: #166534;
}

.voditka-package-progress-chip.warning {
    border-color: #d97706;
    background: #fef3c7;
    color: #92400e;
}

.voditka-package-progress-chip.warning span {
    color: #a16207;
}

.voditka-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.voditka-toolbar-compact {
    margin-top: 0;
    margin-bottom: 8px;
}

.voditka-package-footer-toolbar {
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--neutral-stroke-rest);
}

.voditka-package-weight {
    color: var(--accent-foreground-rest);
    font-size: 1rem;
    white-space: nowrap;
}

.voditka-package-po-toolbar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--neutral-stroke-rest);
}

.voditka-package-po-toolbar .voditka-section-title {
    margin-bottom: 0;
}

.voditka-count-editor {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
}

.voditka-count-editor label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: var(--neutral-foreground-hint);
    font-size: 0.82rem;
    font-weight: 600;
}

.voditka-count-editor input {
    height: 34px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    padding: 0 8px;
    color: var(--neutral-foreground-rest);
    background: var(--neutral-fill-input-rest);
}

.voditka-section-title {
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.voditka-whole-package-scan {
    margin-bottom: 10px;
}

.voditka-whole-package-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.voditka-whole-package-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 10px;
    background: var(--neutral-fill-rest);
}

.voditka-whole-package-controls {
    display: grid;
    grid-template-columns: minmax(68px, max-content) 40px minmax(58px, auto) 40px minmax(82px, auto);
    gap: 6px;
    align-items: center;
    justify-content: start;
}

.voditka-whole-package-quantity-label {
    color: var(--neutral-foreground-hint);
    font-size: 0.82rem;
    font-weight: 600;
}

.voditka-quantity-button {
    min-width: 40px;
    width: 40px;
}

.voditka-whole-package-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 32px;
    border-radius: 6px;
    background: var(--neutral-fill-secondary-rest);
    font-size: 0.92rem;
    white-space: nowrap;
}

.voditka-package-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 100%;
    scrollbar-width: thin;
}

.voditka-package {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 76px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--neutral-fill-rest);
    color: var(--neutral-foreground-rest);
}

.voditka-package.selected {
    border-color: var(--accent-fill-rest);
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest);
}

.voditka-package strong {
    min-width: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    text-align: center;
    font-size: 0.78rem;
}

.voditka-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
}

.voditka-item-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    align-items: start;
}

.voditka-item-main span {
    overflow-wrap: anywhere;
}

.voditka-transfer-controls {
    display: grid;
    grid-template-columns: minmax(64px, 82px) auto minmax(92px, auto);
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.voditka-transfer-quantity-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    padding: 0 8px;
    color: var(--neutral-foreground-rest);
    background: var(--neutral-fill-input-rest);
    box-sizing: border-box;
}

.voditka-package-row.loaded {
    border-color: #16a34a;
}

.voditka-package-row.loaded .swipe-action-row__content {
    background: rgba(22, 163, 74, 0.08);
}

.voditka-package-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.voditka-package-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 6px;
    background: var(--neutral-fill-secondary-rest);
    font-weight: 800;
}

.voditka-package-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.voditka-package-info span {
    color: var(--neutral-foreground-hint);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.voditka-load-status {
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--neutral-fill-rest);
    color: var(--neutral-foreground-hint);
    font-size: 0.78rem;
    font-weight: 700;
}

.voditka-load-status.loaded {
    background: #dcfce7;
    color: #166534;
}

@media (max-width: 760px) {
    .voditka-order-summary,
    .voditka-workspace {
        grid-template-columns: 1fr;
    }

    .voditka-load-summary,
    .voditka-baliky-page .voditka-load-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .voditka-package-line {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .voditka-load-status {
        grid-column: 1 / -1;
        width: fit-content;
    }

    .voditka-transfer-controls {
        grid-template-columns: minmax(64px, 82px) auto;
    }

    .voditka-transfer-controls fluent-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .voditka-page {
        padding: 6px;
    }

    .voditka-panel {
        padding: 10px;
    }

    .voditka-scan-panel {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .voditka-scan-line {
        gap: 6px;
    }

    .voditka-scan-line fluent-button {
        flex-basis: calc(50% - 3px);
    }

    .voditka-section-title {
        font-size: 0.86rem;
    }

    .voditka-package-line {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 8px;
    }

    .voditka-package-label {
        min-height: 42px;
        font-size: 0.95rem;
    }

    .voditka-package-info strong,
    .voditka-item-main strong {
        overflow-wrap: anywhere;
    }

    .voditka-load-status {
        font-size: 0.76rem;
    }

    .voditka-whole-package-controls {
        grid-template-columns: minmax(64px, max-content) 38px minmax(56px, auto) 38px minmax(78px, 1fr);
        width: 100%;
    }

    .voditka-baliky-order-list {
        max-height: calc(100dvh - 270px);
    }

    .voditka-baliky-order-row {
        grid-template-columns: 1fr;
    }

    .voditka-baliky-order-progress {
        align-items: flex-start;
    }

    .voditka-baliky-label-chip {
        min-width: 62px;
        padding-inline: 7px;
    }

    .voditka-baliky-loose-item {
        grid-template-columns: 1fr;
    }

    .voditka-baliky-loose-quantity {
        align-items: flex-start;
    }

    .voditka-baliky-loose-controls {
        justify-content: start;
    }
}
