/* ============================================================
   Warranty Manager — Frontend CSS
   sonweb.net
   ============================================================ */

.wm-lookup-wrap {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Header */
.wm-lookup-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a18;
}
.wm-lookup-sub {
    font-size: 14px;
    color: #888;
    margin: 0 0 18px;
}

/* Tabs */
.wm-tabs {
    display: flex;
    border: 1px solid #e5e4e0;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
    margin-bottom: 14px;
}
.wm-tab {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.wm-tab.active {
    background: #eff3ff;
    color: #2563eb;
    font-weight: 600;
}
.wm-tab:hover:not(.active) { background: #f5f4f0; }

/* Form */
.wm-lookup-form { margin-bottom: 0; }
.wm-input-row {
    display: flex;
    gap: 8px;
}
.wm-input {
    flex: 1;
    font-size: 15px;
    padding: 10px 16px !important;
    border: 1.5px solid #e5e4e0;
    border-radius: 8px !important;
    color: #1a1a18;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.wm-input:focus { border-color: #2563eb; }
.wm-btn-search {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.wm-btn-search:hover  { background: #1d4ed8; }
.wm-btn-search:active { transform: scale(.98); }
.wm-btn-search:disabled { background: #9ca3af; cursor: not-allowed; }

/* Result area */
.wm-result { margin-top: 20px; }

/* ---- Single result card ---- */
.wm-result-card {
    border: 1px solid #e5e4e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.wm-result-header {
    display: flex;
    gap: 14px;
    padding: 16px;
    align-items: flex-start;
    border-bottom: 1px solid #f0efeb;
}
.wm-product-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e4e0;
    flex-shrink: 0;
}
.wm-product-img-placeholder {
    width: 72px;
    height: 72px;
    background: #f5f4f0;
    border: 1px solid #e5e4e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.wm-result-info { flex: 1; }
.wm-product-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a18;
    margin: 0 0 4px;
}
.wm-product-serial {
    font-size: 12px;
    color: #aaa;
    font-family: monospace;
}
.wm-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.wm-info-field {
    padding: 11px 16px;
    border-bottom: 1px solid #f0efeb;
}
.wm-info-field:nth-child(odd)  { border-right: 1px solid #f0efeb; }
.wm-info-field:nth-last-child(-n+2) { border-bottom: none; }
.wm-info-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 3px;
}
.wm-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a18;
}

/* Status bar */
.wm-status-bar {
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid transparent;
}
.wm-status-active   { background: #f0fdf4; border-color: #bbf7d0; }
.wm-status-expiring { background: #fffbeb; border-color: #fde68a; }
.wm-status-expired  { background: #fef2f2; border-color: #fecaca; }
.wm-status-repaired { background: #eff3ff; border-color: #bfcfff; }
.wm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wm-status-active .wm-status-dot   { background: #16a34a; }
.wm-status-expiring .wm-status-dot { background: #d97706; }
.wm-status-expired .wm-status-dot  { background: #dc2626; }
.wm-status-repaired .wm-status-dot { background: #2563eb; }
.wm-status-text {
    font-size: 13px;
    font-weight: 600;
}
.wm-status-active .wm-status-text   { color: #16a34a; }
.wm-status-expiring .wm-status-text { color: #d97706; }
.wm-status-expired .wm-status-text  { color: #dc2626; }
.wm-status-repaired .wm-status-text { color: #2563eb; }
.wm-progress-wrap {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,.08);
    border-radius: 2px;
    margin: 0 8px;
}
.wm-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .6s ease;
}
.wm-status-active .wm-progress-fill   { background: #16a34a; }
.wm-status-expiring .wm-progress-fill { background: #d97706; }
.wm-status-expired .wm-progress-fill  { background: #dc2626; opacity: .5; }
.wm-progress-pct {
    font-size: 11px;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}
.wm-status-active .wm-progress-pct   { color: #16a34a; }
.wm-status-expiring .wm-progress-pct { color: #d97706; }
.wm-status-expired .wm-progress-pct  { color: #dc2626; }

/* ---- Multi result ---- */
.wm-summary-bar {
    background: #f8f8f6;
    border: 1px solid #e5e4e0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.wm-summary-name  { font-size: 15px; font-weight: 700; color: #1a1a18; }
.wm-summary-count { font-size: 12px; color: #888; margin-top: 1px; }
.wm-summary-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.wm-stat-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 10px;
}
.wm-stat-active   { background: #f0fdf4; color: #16a34a; }
.wm-stat-expiring { background: #fffbeb; color: #d97706; }
.wm-stat-expired  { background: #fef2f2; color: #dc2626; }

/* Product list cards */
.wm-product-list { display: flex; flex-direction: column; gap: 10px; }
.wm-pcard {
    border: 1px solid #e5e4e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s;
}
.wm-pcard:hover { border-color: #bfbfba; }
.wm-pcard-body {
    display: flex;
    gap: 14px;
    padding: 14px;
    align-items: center;
}
.wm-pcard-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e4e0;
    flex-shrink: 0;
}
.wm-pcard-img-ph {
    width: 52px;
    height: 52px;
    background: #f5f4f0;
    border: 1px solid #e5e4e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.wm-pcard-info  { flex: 1; min-width: 0; }
.wm-pcard-name  { font-size: 14px; font-weight: 700; color: #1a1a18; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-pcard-serial { font-size: 11px; color: #aaa; font-family: monospace; margin-top: 2px; }
.wm-pcard-meta  { font-size: 12px; color: #888; margin-top: 4px; }
.wm-pcard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

/* Badges */
.wm-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}
.wm-badge-active   { background: #f0fdf4; color: #16a34a; }
.wm-badge-expiring { background: #fffbeb; color: #d97706; }
.wm-badge-expired  { background: #fef2f2; color: #dc2626; }
.wm-badge-repaired { background: #eff3ff; color: #2563eb; }

/* Mini progress */
.wm-mini-progress {
    width: 80px;
    height: 3px;
    background: #e5e4e0;
    border-radius: 2px;
}
.wm-mini-fill { height: 100%; border-radius: 2px; }
.wm-fill-active   { background: #16a34a; }
.wm-fill-expiring { background: #d97706; }
.wm-fill-expired  { background: #dc2626; opacity: .5; }
.wm-fill-repaired { background: #2563eb; }
.wm-expire-text { font-size: 11px; color: #aaa; }

/* Card footer */
.wm-pcard-footer {
    border-top: 1px solid #f0efeb;
    padding: 8px 14px;
    background: #fafaf8;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.wm-pcard-footer span { font-size: 12px; color: #aaa; }
.wm-pcard-footer strong { color: #555; font-weight: 600; }

/* Error / not found */
.wm-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px 20px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}

@media ( max-width: 480px ) {
    .wm-info-grid { grid-template-columns: 1fr; }
    .wm-info-field:nth-child(odd) { border-right: none; }
    .wm-info-field:nth-last-child(-n+2) { border-bottom: 1px solid #f0efeb; }
    .wm-info-field:last-child { border-bottom: none; }
    .wm-input-row { flex-direction: column; }
    .wm-pcard-right { display: none; }
}
