/* serial-tag.css - Serial number chip/tag input widget */

.serial-tag-box {
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    min-height: 38px;
    cursor: text;
    position: relative;
    padding: 2px 4px 2px 4px;
    box-sizing: border-box;
}

.serial-tag-box:focus-within {
    border-color: #66afe9;
    box-shadow: 0 0 4px rgba(102,175,233,.4);
    outline: none;
}

.serial-tag-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    min-height: 30px;
}

.serial-chip {
    display: inline-flex;
    align-items: center;
    background: #e0f0ff;
    border: 1px solid #9ecfff;
    border-radius: 3px;
    padding: 1px 4px 1px 6px;
    font-size: 12px;
    font-family: monospace;
    line-height: 20px;
    user-select: none;
    cursor: default;
    white-space: nowrap;
}

.serial-chip .chip-text {
    color: #1a5ba8;
}

.serial-chip .chip-remove {
    margin-left: 4px;
    color: #888;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.serial-chip .chip-remove:hover {
    color: #c00;
}

.serial-type-input {
    border: none;
    outline: none;
    box-shadow: none;
    font-size: 12px;
    font-family: monospace;
    flex: 1;
    min-width: 120px;
    padding: 2px 4px;
    background: transparent;
}

.serial-type-input::placeholder {
    color: #aaa;
    font-family: sans-serif;
}

/* Suggestions dropdown */
.serial-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
}

.serial-sugg-item {
    padding: 5px 10px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    color: #333;
}

.serial-sugg-item:hover {
    background: #e8f0fe;
    color: #1a5ba8;
}

.serial-sugg-empty {
    padding: 6px 10px;
    color: #999;
    font-size: 12px;
}

/* Count label below the box */
.serial-count-label {
    font-size: 10px;
    color: #777;
    margin-top: 2px;
    display: block;
}

/* Warning chip: serial already SOLD in system */
.serial-chip.serial-chip-warning {
    background: #fff3cd;
    border-color: #e0a800;
    animation: chipWarnPulse 0.4s ease;
}
.serial-chip.serial-chip-warning .chip-text {
    color: #856404;
    font-weight: bold;
}

/* Info chip: serial already exists as Available */
.serial-chip.serial-chip-info {
    background: #d1ecf1;
    border-color: #17a2b8;
}
.serial-chip.serial-chip-info .chip-text {
    color: #0c5460;
}

@keyframes chipWarnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
