/* ==========================================================================
   1. CẤU TRÚC CHUNG & TYPOGRAPHY
   ========================================================================== */
.section-baohanh {
background-image: radial-gradient(circle, #aed16b, #71d38f, #1fd0b7, #00c9d9, #26bdec, #42bef1, #57bef5, #69bff8, #52cffe, #41dfff, #46eefa, #5ffbf1);
}

.akira-warranty-lookup, 
.akira-activation-wrapper { 
    max-width: 850px; 
    margin: 40px auto; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    color: #333; 
    line-height: 1.6;
}

.ak-title { 
    text-align: center; 
    color: #2c3e50; 
    margin-bottom: 30px; 
    font-size: 26px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}

/* ==========================================================================
   2. GIAO DIỆN TAB & HEADER (STYLE APP HIỆN ĐẠI)
   ========================================================================== */
.akira-pro-wrapper {
    max-width: 720px;
    margin: 40px auto;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #444;
}

.ak-header-section { text-align: center; margin-bottom: 25px; }
.ak-main-title { font-size: 28px; font-weight: 800; color: #1a1a1a; margin: 0 0 5px 0; }
.ak-main-title span { color: #007bff; }
.ak-sub-title { color: #6c757d; font-size: 15px; margin: 0; }

.ak-modern-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    padding: 20px;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: visible !important; /* Quan trọng để Dropdown không bị cắt */
}

/* Tabs Header */
.ak-tabs-header {
    display: flex;
    background: #f2f4f8;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 25px;
}
.ak-tab-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ak-tab-item.active {
    background: #fff;
    color: #007bff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.ak-tab-content { display: none; animation: fadeIn 0.4s; }
.ak-tab-content.active { display: block; }

/* ==========================================================================
   3. FORM INPUTS & BUTTONS
   ========================================================================== */
.ak-field-group { margin-bottom: 15px; }
.ak-field-group label {
    display: block; font-size: 11px; font-weight: 700; color: #8898aa;
    text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.5px;
}
.ak-input-icon { position: relative; }

/* Input chuẩn */
.ak-modern-form input[type="text"],
.ak-modern-form input[type="date"],
.ak-modern-form input[type="email"] {
    width: 100%;
    background: #f7fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 12px 15px;
    padding-right: 40px; /* Chừa chỗ cho icon */
    font-size: 15px;
    color: #333;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    height: 48px;
    margin: 0;
}
.ak-modern-form input:focus {
    background: #fff; border-color: #007bff; box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}
.ak-input-icon .dashicons {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #adb5bd;
}
.ak-row-split { display: flex; gap: 15px; }
.ak-row-split .ak-field-group { flex: 1; }

/* Nút bấm Gradient */
.ak-btn-gradient {
    width: 100%; padding: 14px; border: none; border-radius: 12px;
    color: white; font-weight: 700; font-size: 16px; cursor: pointer;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 5px 15px rgba(0, 114, 255, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.2s; margin-top: 10px;
}
.ak-btn-gradient.purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 5px 15px rgba(161, 140, 209, 0.3);
}
.ak-btn-gradient:hover { transform: translateY(-2px); }

.ak-card-footer { text-align: center; margin-top: 25px; padding-top: 20px; border-top: 1px dashed #eee; color: #6c757d; font-size: 13px; }

/* ==========================================================================
   4. SELECT2 CUSTOMIZATION (PHIÊN BẢN CHUẨN - GỘP)
   ========================================================================== */
.select2-container, 
.select2-dropdown, 
.select2-search__field,
.select2-results {
    box-sizing: border-box !important;
}

.select2-container .select2-selection--single {
    height: auto !important; 
    min-height: 48px !important; 
    background: #f7fafc !important;
    border: 1px solid #eef2f7 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    padding: 5px 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333 !important;
    padding-left: 15px !important;
    padding-right: 30px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    white-space: normal !important; 
    word-break: break-word !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important; right: 10px !important;
    display: flex !important; align-items: center !important;
}

.select2-dropdown {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 0 0 10px 10px !important;
    z-index: 99999999 !important; 
    display: block !important;
    visibility: visible !important;
}

.select2-search--dropdown {
    padding: 10px !important;
    background-color: #f1f1f1 !important;
    display: block !important;
}

.select2-search__field {
    border: 1px solid #ccc !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    width: 100% !important;
    height: 35px !important;
    margin: 0 !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 16px !important; 
}

.select2-results {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
    background: #fff !important;
}

.select2-results__option {
    padding: 10px 15px !important;
    border-bottom: 1px dashed #eee !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    display: block !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #007bff !important; color: #fff !important;
}
.select2-results__option[aria-selected="true"] {
    background-color: #f0f0f0 !important; font-weight: bold !important;
}

select.select2-hidden-accessible {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important; height: 1px !important;
    overflow: hidden !important; clip: rect(0,0,0,0) !important;
}

/* ==========================================================================
   5. HIỂN THỊ KẾT QUẢ TRA CỨU (CARD STYLE)
   ========================================================================== */
.ak-result-container { margin-top: 20px; }
.ak-result-item {
    border: 1px solid #e0e0e0; border-radius: 10px; 
    padding: 15px; margin-bottom: 15px; background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.ak-res-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 10px; border-bottom: 1px dashed #eee; padding-bottom: 8px; 
}
.ak-res-name { font-weight: 700; color: #333; font-size: 16px; }
.ak-res-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; color: #fff; }
.ak-res-badge.valid { background: #28a745; }
.ak-res-badge.expired { background: #dc3545; }
.ak-res-badge.pending { background: #ffc107; color: #333; }
.ak-res-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 14px; }
.ak-res-row strong { color: #007bff; }
.ak-alert { padding: 15px; border-radius: 8px; font-size: 14px; text-align: center; }
.ak-alert.error { background: #ffebee; color: #c62828; }

/* ==========================================================================
   6. RESPONSIVE MOBILE FIX
   ========================================================================== */
@media (max-width: 768px) {
    .akira-pro-wrapper { padding: 0 10px; margin-top: 20px; }
    .ak-row-split { flex-direction: column; gap: 0; }
    .select2-dropdown {
        left: 0 !important;
        margin-left: 0 !important;
    }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   === PHẦN BỔ SUNG: STYLE CHO NÚT CHECK & ẨN HIỆN FORM ===
   ========================================================================== */
.ak-input-group-check {
    display: flex; gap: 10px; align-items: stretch;
}
.ak-input-group-check .ak-input-icon { flex: 1; }

/* Nút Check dùng chung style Gradient của theme gốc cho đồng bộ */
.ak-btn-check {
    border: none; border-radius: 10px; padding: 0 25px;
    font-weight: 700; font-size: 14px; cursor: pointer; color: white;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.2);
    transition: all 0.3s; white-space: nowrap; display: flex; align-items: center;margin-bottom: 0;
}
.ak-btn-check:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 114, 255, 0.3); }
.ak-btn-check:disabled { background: #e2e6ea; color: #6c757d; cursor: not-allowed; box-shadow: none; transform: none; }

/* Hiệu ứng trượt xuống */
#ak-step-2 {
    margin-top: 25px; padding-top: 25px; border-top: 1px dashed #eef2f7;
    animation: slideDown 0.5s ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* --- CSS KẾT QUẢ TRA CỨU (LAYOUT MỚI) --- */

.ak-res-flex {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* CỘT TRÁI (Ảnh) */
.ak-res-left {
    width: 85px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ak-img-box {
    width: 80px;
    height: 80px;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.ak-res-prod-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ak-brand-box img {
    max-width: 80px;
    height: auto;
}

/* CỘT PHẢI (Thông tin) */
.ak-res-right {
    flex-grow: 1;
    width: 100%;
}

.ak-res-header-simple {
    margin-bottom: 8px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.ak-res-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.ak-res-body .ak-res-row {
    font-size: 13px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

/* FOOTER TRẠNG THÁI */
.ak-res-footer-status {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    text-align: right; /* Đẩy nút sang phải */
}

.ak-res-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

/* Màu sắc badge */
.ak-res-badge.valid { background: #28a745; }
.ak-res-badge.expired { background: #dc3545; }
.ak-res-badge.pending { background: #ffc107; color: #333; }

/* Mobile Responsive */
@media (max-width: 480px) {
    .ak-res-flex {
        align-items: flex-start;
    }
    .ak-res-left {
        width: 65px;
    }
    .ak-img-box {
        width: 60px; height: 60px;
    }
    .ak-res-name {
        font-size: 14px;
    }
}

/* Badge Trạng thái xử lý (Frontend) */
.ak-req-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 10px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ak-req-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 3px;
    margin-top: -2px;
}

/* Các màu sắc tương ứng */
.ak-st-pending   { color: #e67e22; } /* Cam đất */
.ak-st-reject    { background: #343a40; } /* Đen xám */
.ak-st-sending   { background: #fd7e14; } /* Cam tươi */
.ak-st-paid      { background: #f1c40f; color: #333; } /* Vàng */
.ak-st-wait      { background: #9b59b6; } /* Tím */
.ak-st-replaced  { background: #1abc9c; } /* Xanh ngọc */
.ak-st-completed { color: #27ae60; } /* Xanh lá */

/* Nút Báo Lỗi (Style lại chút cho đẹp) */
.ak-btn-request {
    margin-left: 10px; 
    cursor: pointer; 
    background: #fff; 
    border: 1px solid #dc3545; 
    color: #dc3545; 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: bold;
    transition: all 0.2s;
}
.ak-btn-request:hover {
    background: #dc3545;
    color: #fff;
}

/* TIMELINE STYLE */
.ak-timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e9ecef;
    margin-left: 10px;
}

.ak-timeline-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
}

.ak-timeline-list li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #007bff;
    border-radius: 50%;
}

.ak-tl-time {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
}

.ak-tl-status {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}

/* Màu chữ theo trạng thái */
.ak-st-completed { color: #28a745; }
.ak-st-paid_repair { color: #d63384; }
.ak-st-reject { color: #343a40; }
.ak-st-checking { color: #007bff; }

.ak-tl-note {
    font-size: 12px;
    color: #555;
    background: #f8f9fa;
    padding: 5px 8px;
    border-radius: 4px;
    margin-top: 3px;
}

/* Nút Toggle Tiến độ */
.ak-btn-toggle-timeline {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    width: 100%; /* Hoặc để width: auto nếu muốn nút nhỏ */
    justify-content: center;
}

.ak-btn-toggle-timeline:hover {
    background: #e9ecef;
    color: #007bff;
}

.ak-btn-toggle-timeline .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ẩn bớt margin thừa của timeline list khi nằm trong container này */
.ak-history-container .ak-timeline-list {
    margin-top: 5px;
}

.ak-timeline-group {
    margin-bottom: 20px;
    background: #fff;
    border-left: 3px solid #007bff; /* Đường viền xanh bên trái */
    padding-left: 15px;
}

.ak-group-title {
    font-weight: 800;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* Chỉnh lại timeline list một chút cho khớp với group */
.ak-timeline-list {
    border-left: 2px solid #e9ecef; /* Giữ nguyên */
    margin-left: 5px; /* Thụt vào so với border group */
}