/* ==========================================
   1. RESET & BASE (CƠ BẢN VÀ MÀU SẮC)
   ========================================== */
.akira-wrap, #akira-modal-overlay, #akira-transfer-modal-overlay, #akira-import-modal-overlay { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 
    font-size: 13px; line-height: 1.5; color: #3c434a; text-align: left; 
}
.akira-wrap * { box-sizing: border-box; }
.akira-wrap h1, .akira-wrap h2, .akira-wrap h3, .akira-wrap h4, .akira-wrap p, #akira-modal-overlay h3, #akira-modal-overlay p { 
    margin: 0; padding: 0; text-transform: none !important; letter-spacing: normal !important; color: inherit; 
}
.akira-wrap a { text-decoration: none !important; box-shadow: none !important; color: #2271b1; }
.akira-wrap table { border-collapse: separate !important; border-spacing: 0 !important; border: none !important; width: 100% !important; margin: 0 !important; background: transparent !important;}
.akira-wrap th, .akira-wrap td { padding: 0; border: none; background: transparent; text-align: left; }
.akira-wrap button, .akira-wrap .button, #akira-modal-overlay button { 
    text-transform: none !important; letter-spacing: normal !important; text-shadow: none !important; 
    font-weight: 600 !important; border-radius: 4px !important; margin: 0; display: inline-flex; align-items: center; justify-content: center;
}

/* Badge Trạng Thái (Fix lỗi mất nền) */
.badge { 
    padding: 3px 8px !important; border-radius: 12px !important; font-size: 11px !important; 
    font-weight: bold !important; border: none !important; margin: 0;
}
.badge-ok { background-color: #e6f4ea !important; color: #1e8e3e !important; }
.badge-warn { background-color: #fef7e0 !important; color: #b06000 !important; }
.badge-danger { background-color: #fce8e6 !important; color: #d63638 !important; }

/* ==========================================
   2. HỆ THỐNG TAB UI & FORM INPUT
   ========================================== */
.akira-nav-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #ccc; padding-bottom: 0; }
.akira-tab-btn { background: #e0e0e0; color: #555; border: none; padding: 10px 20px; font-size: 15px; font-weight: bold; border-radius: 8px 8px 0 0; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 8px; }
.akira-tab-btn:hover { background: #d5d5d5; color: #222; }
.akira-tab-btn.active { background: #2271b1; color: #fff; }
.akira-tab-content { display: none; animation: akiraFadeIn 0.4s; }
.akira-tab-content.active { display: block; }
@keyframes akiraFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.akira-wrap input.in-text, .akira-wrap select.in-text, .akira-wrap textarea.in-text { 
    min-height: 36px !important; height: auto !important; margin: 3px 0 !important; padding: 8px 12px !important; 
    background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; border-radius: 4px !important; 
    color: #333 !important; font-size: 14px !important; width: 100% !important; box-sizing: border-box !important; 
    outline: none !important; transition: 0.2s;
}
.akira-wrap input.in-text:focus, .akira-wrap select.in-text:focus, .akira-wrap textarea.in-text:focus { 
    border-color: #2271b1 !important; box-shadow: 0 0 0 1px #2271b1 !important; 
}

/* ==========================================
   3. DASHBOARD CARDS & TỔNG QUAN
   ========================================== */
.akira-dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 15px 0; }
.dash-card { 
    background: #fff; padding: 15px 20px; border-radius: 8px; border: 2px solid transparent; 
    border-left: 4px solid #2271b1; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; 
    flex-direction: column; justify-content: center; transition: 0.2s; cursor: pointer; position: relative;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.dash-card.active { border-color: #2271b1; background-color: #f0f6fb; }
.dash-card.warn.active { border-color: #f56e28; background-color: #fff8f5; }
.dash-card.danger.active { border-color: #d63638; background-color: #fcf0f0; }
.dash-card h4 { margin: 0 0 5px; font-size: 12px; color: #666; text-transform: uppercase; }
.dash-card p { margin: 0; font-size: 28px; font-weight: bold; color: #2c3338; }
.dash-card.warn { border-left-color: #f56e28; }
.dash-card.danger { border-left-color: #d63638; }

/* ==========================================
   4. THANH SEARCH TRƯỢT THÔNG MINH (STICKY EXPANDABLE)
   ========================================== */
.akira-sticky-search {
    position: sticky; top: 32px; z-index: 800; background: #fff; padding: 15px 20px; margin: 0 0 20px 0 !important; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #ccd0d4; border-bottom: 2px solid #2271b1; 
    transition: max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-radius 0.4s ease, background-color 0.4s ease;
    max-width: 100%; max-height: 500px; overflow: hidden; border-radius: 8px;
}
.akira-top-tools { display:flex; align-items:center; flex-wrap:wrap; gap:15px; width: 100%;}
.search-wrap { flex: 2; min-width: 250px; position: relative; }
#akira-search-input { width: 100%; height: 40px !important; padding: 12px 12px 12px 38px !important; border: 1px solid #ccd0d4 !important; border-color: #2271b1 !important; border-radius: 6px !important; font-size: 14px !important; box-shadow: 0 2px 5px rgba(34,113,177,0.1) !important;}
.search-wrap:before { content: "\f179"; font-family: dashicons; position: absolute; left: 12px; top: 12px; color: #888; font-size: 20px; }
.sort-wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.sort-wrap select { min-height: 40px !important; height: 40px !important; font-weight: 500;}

.akira-filter-pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 15px; }
.akira-pill { white-space: nowrap; padding: 6px 14px; background: #fff; border: 1px solid #c5e1f5; border-radius: 20px; cursor: pointer; font-size: 13px; color: #2271b1; font-weight: 500; transition: 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.akira-pill:hover { background: #e0f0fa; }
.akira-pill.active { background: #2271b1; color: #fff; border-color: #2271b1; box-shadow: 0 2px 5px rgba(34,113,177,0.3); }

/* TRẠNG THÁI THU GỌN KHI CUỘN CHUỘT (TỰ MỞ KHI HOVER/FOCUS) */
.akira-sticky-search.collapsed {
    max-width: 46px; max-height: 46px; padding: 0 12px !important; border-radius: 23px !important; 
    margin-left: auto; margin-right: 20px; background: #2271b1 !important; border: 2px solid #fff !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important; cursor: pointer;
}
.akira-sticky-search.collapsed:hover, .akira-sticky-search.collapsed:focus-within {
    max-width: 800px; max-height: 300px; border-radius: 8px !important; background: #fff !important; padding: 15px 20px !important; cursor: default;
}
.akira-sticky-search.collapsed:not(:hover):not(:focus-within) .akira-filter-pills, 
.akira-sticky-search.collapsed:not(:hover):not(:focus-within) .sort-wrap, 
.akira-sticky-search.collapsed:not(:hover):not(:focus-within) #bulk-edit-toolbar { 
    opacity: 0; visibility: hidden; height: 0; margin: 0; padding: 0; transition: all 0.2s ease; 
}
.akira-sticky-search.collapsed:not(:hover):not(:focus-within) #akira-search-input { opacity: 0; width: 0; padding: 0; border: none; }
.akira-sticky-search.collapsed:not(:hover):not(:focus-within) .search-wrap:before { color: #fff !important; top: 5px; left: 0px; font-size: 22px; }

.akira-sticky-search.collapsed:hover .akira-filter-pills, .akira-sticky-search.collapsed:focus-within .akira-filter-pills, 
.akira-sticky-search.collapsed:hover .sort-wrap, .akira-sticky-search.collapsed:focus-within .sort-wrap { 
    opacity: 1; visibility: visible; height: auto; transition: opacity 0.4s ease 0.2s; 
}
.akira-sticky-search.collapsed:hover #akira-search-input, .akira-sticky-search.collapsed:focus-within #akira-search-input { 
    opacity: 1; width: 100%; transition: opacity 0.4s ease 0.2s; 
}

/* ==========================================
   5. DANH SÁCH KHÁCH HÀNG & PHÂN NHÁNH VỊ TRÍ
   ========================================== */
.akira-list-wrapper { display: flex; flex-direction: column; gap: 15px; margin-top: 15px; }
.akira-customer-block { display: flex; flex-direction: column; background: #fff; border: 1px solid #ccd0d4; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: box-shadow 0.2s; overflow: visible;}
.akira-customer-block:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.akira-cust-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: #fbfbfb; cursor: pointer; border-radius: 8px; transition: background 0.2s; }
.akira-cust-header:hover { background: #f0f6fb; }
.akira-customer-block.is-open .akira-cust-header { border-radius: 8px 8px 0 0; border-bottom: 1px solid #eee; background: #f0f6fb; }
.cust-info-left { display: flex; flex-direction: column; gap: 5px; flex-wrap: wrap; }
.akira-cust-name { font-size: 16px; color: #2271b1; margin: 0; font-weight: bold; display: flex; align-items: center; gap: 8px;}
.akira-cust-meta { display: flex; align-items: center; gap: 15px; font-size: 13px; color: #555; margin-top: 0;}
.cust-info-right { display: flex; align-items: center; gap: 15px; }
.dev-count-badge { background: #e0f0fa; color: #2271b1; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; }
.toggle-icon { transition: transform 0.3s; color: #888; }
.akira-customer-block.is-open .toggle-icon { transform: rotate(180deg); color: #2271b1; }
.akira-dev-side { padding: 20px; background: #fff; border-radius: 0 0 8px 8px; display: none; }
.akira-customer-block.is-open .akira-dev-side { display: block; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* Accordion Vị trí lắp đặt */
.akira-loc-card-wrap { border: 1px solid #ddd; border-radius: 8px; margin-bottom: 15px; overflow: hidden; }
.akira-loc-header { background: #f9f9f9; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s;}
.akira-loc-header:hover { background: #f0f6fb; }
.akira-loc-body { padding: 15px; background: #fff; }
.map-link { display: inline-flex; align-items: center; background: #ea4335; padding: 2px 8px; border-radius: 12px; text-decoration: none !important; margin-left: 5px; color: #fff !important; font-weight: 600; font-size: 11px;}

/* Dropdown Tooltip Khách hàng */
.cust-dropdown { position: relative; }
.btn-toggle-menu { display: flex; align-items: center; justify-content: center; gap: 5px; background: #fff; border: 1px solid #ccd0d4; padding: 5px 12px; border-radius: 4px; cursor: pointer; color: #2271b1 !important; font-weight: 600; transition: 0.2s; height: 32px;}
.btn-toggle-menu:hover { border-color: #2271b1; background: #f0f6fb; }
.ping-all-cust-btn { display: flex; align-items: center; justify-content: center; gap: 5px; background: #fffcf5; border: 1px solid #f5cbaf; padding: 5px 12px; border-radius: 4px; cursor: pointer; color: #d35400 !important; font-weight: 600; transition: 0.2s; height: 32px;}
.ping-all-cust-btn:hover { background: #f56e28; color: #fff !important; border-color: #f56e28; }
.cust-dropdown-content { display: none; position: absolute; right: 0; top: calc(100% + 5px); z-index: 99999; background: #fff; min-width: 220px; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 5px 25px rgba(0,0,0,0.2); overflow: hidden; flex-direction: column; }
.cust-dropdown-content.show { display: flex !important; }
.cust-dropdown-content a, .cust-dropdown-content button { display: block; width: 100%; text-align: left; padding: 10px 15px; background: transparent; border: none; border-bottom: 1px solid #eee; cursor: pointer; color: #3c434a !important; font-size: 13px; text-decoration: none; transition: 0.2s; box-sizing: border-box; }
.cust-dropdown-content a:hover, .cust-dropdown-content button:hover { background: #f0f6fb; color: #2271b1 !important; padding-left: 20px; }

/* Badge phân loại số lượng nhỏ */
.akira-badge-small { 
    display: inline-flex; align-items: center; padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: help; 
    background: #e0f0fa; border: 1px solid #b3d4fc; border-radius: 20px; color: #2271b1; margin: 2px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; max-width: 48px; white-space: nowrap;
}
.akira-badge-small .badge-text { opacity: 0; visibility: hidden; transition: 0.2s; width: 0; display: inline-block; }
.akira-badge-small:hover { background: #2271b1; color: #ffffff !important; border-color: #2271b1; max-width: 250px; padding-right: 15px; box-shadow: 0 3px 8px rgba(34, 113, 177, 0.3); }
.akira-badge-small:hover .badge-text { opacity: 1; visibility: visible; width: auto; margin-left: 6px; color: #ffffff; }
.akira-badge-small:hover b { color: #ffffff; }
.akira-badge-small.gray { background: #f9f9f9; color: #555; border-color: #ddd; max-width: none; }

.dev-count-wrapper:hover .cust-badges-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.cust-badges-tooltip {
    position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border: 1px solid #ccd0d4; border-radius: 8px; padding: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; gap: 8px; min-width: max-content; z-index: 9999;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.2s ease;
}
.cust-badges-tooltip .akira-badge-small { max-width: none !important; margin: 0; padding-right: 15px; }
.cust-badges-tooltip .akira-badge-small .badge-text { opacity: 1; visibility: visible; width: auto; margin-left: 6px; }
.cust-badges-tooltip::before { content: ''; position: absolute; top: -6px; right: 25px; width: 10px; height: 10px; background: #fff; border-left: 1px solid #ccd0d4; border-top: 1px solid #ccd0d4; transform: rotate(45deg); }

/* Nút liên hệ siêu nhỏ */
.quick-contact-btns { display: inline-flex; gap: 5px; margin-left: 5px; vertical-align: middle; }
.btn-zalo { background: #0068ff; color: #fff !important; text-decoration: none; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; transition: 0.2s; }
.btn-call { background: #1e8e3e; color: #fff !important; text-decoration: none; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; transition: 0.2s; }
.btn-zalo:hover, .btn-call:hover { filter: brightness(1.1); transform: scale(1.05); }

/* ==========================================
   6. CARD THIẾT BỊ 2.0 (SMART FLEX GRID)
   ========================================== */
.akira-dev-card {
    border: 1px solid #ebebeb; border-radius: 8px; margin-bottom: 12px; background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s; overflow: hidden; border-left: 5px solid #ccc;
}
.akira-dev-card.health-ok { border-left-color: #1e8e3e; }
.akira-dev-card.health-expiring { border-left-color: #f56e28; }
.akira-dev-card.health-expired { border-left-color: #d63638; }

/* Header Card */
.akira-dev-card-header { display: flex; align-items: center; padding: 12px 15px; cursor: pointer; user-select: none; transition: background 0.2s; }
.akira-dev-card-header:hover { background: #fafbfc; }

/* Sửa lỗi Badge bảo hành trên Header Card */
.akira-dev-card-header .badge { padding: 3px 8px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: bold !important; border: none !important; margin: 0; }
.akira-dev-card-header .badge-ok { background-color: #e6f4ea !important; color: #1e8e3e !important; }
.akira-dev-card-header .badge-warn { background-color: #fef7e0 !important; color: #b06000 !important; }
.akira-dev-card-header .badge-danger { background-color: #fce8e6 !important; color: #d63638 !important; }

.dev-thumbnail {
    width: 44px; height: 44px; border-radius: 6px; background: #f0f0f1; margin-right: 15px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid #e2e4e7;
}
.dev-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.dev-icon-placeholder .dashicons { font-size: 24px; width: 24px; height: 24px; color: #888; }

.dev-summary-info { flex: 1; min-width: 0; }
.dev-title-wrap { margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.dev-name { font-size: 15px; color: #2271b1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-meta-wrap { font-size: 12px; color: #666; display: flex; align-items: center; gap: 5px; }
.dev-ip-text { font-family: monospace; font-weight: bold; color: #d63638; }

.dev-status-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; margin-left: auto; padding-right: 15px; border-right: 1px dashed #eee; }
.install-date-label { font-size: 11px; color: #888; font-weight: 600; white-space: nowrap; }

.dev-expand-btn { width: 40px; text-align: center; color: #888; transition: 0.3s; padding-left: 15px; }
.akira-dev-card.is-expanded .expand-icon { transform: rotate(180deg); color: #2271b1; }
.akira-dev-card.is-expanded .akira-dev-card-header { border-bottom: 1px dashed #eee; background: #f8fafd; }

/* Body Card (Co giãn thông minh) */
.akira-dev-card-body { padding: 15px; background: #fff; width: 100%; box-sizing: border-box; overflow-x: hidden;}
.akira-dev-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: space-between; }
.dev-col { flex: 1 1 20%; min-width: 180px; }
.dev-col.col-actions { flex: 0 0 80px; min-width: 80px; border-right: none; padding-right: 0;}

.dev-col-title { font-size: 10px; color: #999; font-weight: bold; text-transform: uppercase; margin-bottom: 8px; }
.info-row { display: flex; align-items: baseline; margin-bottom: 5px; font-size: 13px; }
.info-label { width: 65px; color: #9a9a9a; flex-shrink: 0; font-size: 12px; }
.info-val { font-weight: 600; word-break: break-all; }
.sn-text { color: #d35400; font-family: monospace; }
.imei-text { color: #8e44ad; font-family: monospace; }
.mac-text { color: #2271b1; font-family: monospace; text-transform: uppercase; }
.ip-text { color: #d63638 !important; font-family: monospace; text-decoration: none !important; }

/* Nút thao tác nhỏ xíu */
.btn-icon-sm { width: 24px; height: 24px; border: none !important; background: transparent !important; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;}
.btn-icon-sm:hover { transform: scale(1.1); background: transparent !important; color: #2271b1 !important; }
.btn-icon-sm .dashicons { font-size: 14px; width: 14px; height: 14px; }
.copy-btn.copied { color: #2e7d32 !important; }

/* Nút lưới thao tác chính (Mắt, Sửa, Xóa) */
.action-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.btn-icon-action { width: 34px; height: 34px; border-radius: 6px; background: #f0f6fb; color: #2271b1; border: 1px solid #c5e1f5; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; padding: 0;}
.btn-icon-action:hover { background: #2271b1; color: #fff; border-color: #2271b1;}
.btn-icon-action.delete-btn { color: #d63638; border-color: #f5c2c7; background: #fff8f5; }
.btn-icon-action.delete-btn:hover { background: #d63638; color: #fff; border-color: #d63638;}

/* Thiết kế viên thuốc cho IP Port / Cloud Port */
.port-tags-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; padding-left: 65px; } 
.port-item-wrapper { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.port-tag { display: inline-flex; align-items: center; background: #f8fafd; border: 1px solid #c5e1f5; border-radius: 20px; padding: 3px 4px 3px 12px; font-size: 13px; transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.port-tag:hover { background: #e0f0fa; border-color: #2271b1; box-shadow: 0 2px 5px rgba(34,113,177,0.15); }
.port-link { color: #2271b1 !important; font-family: 'Consolas', monospace; font-weight: bold; text-decoration: none !important; margin-right: 4px; letter-spacing: 0.5px; }
.port-tag .btn-icon-xs { width: 22px !important; height: 22px !important; min-height: 22px !important; border-radius: 50% !important; background: #fff !important; border: 1px solid #dcdcdc !important; color: #666 !important; margin-left: 4px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.port-tag .btn-icon-xs:hover { background: #2271b1 !important; color: #fff !important; border-color: #2271b1 !important; transform: scale(1.1); }
.port-tag .btn-ping-icon:hover { background: #d35400 !important; border-color: #d35400 !important; color: #fff !important;}
.port-tag .dashicons { font-size: 12px; width: 12px; height: 12px; }
.ping-result { font-size: 11px; line-height: 1.2; text-align: center; }
.ping-ok { color: #1e8e3e; font-weight: bold; }
.ping-fail { color: #d63638; font-weight: bold; }
.btn-ping-device { background: #e6f4ea !important; border: 1px solid #cce8d6 !important; color: #1e8e3e !important; border-radius: 4px; padding: 2px 6px !important; font-size: 10px !important; font-weight: bold !important; cursor: pointer; margin-left: auto; transition: 0.2s;}
.btn-ping-device:hover { background: #d3ead8 !important; border-color: #1e8e3e !important; }

/* Ghi chú thẻ thiết bị */
.akira-dev-footer { margin-top: 15px; padding-top: 10px; border-top: 1px dashed #eee; font-size: 12px; color: #555; }
.media-link-badge { display: inline-flex; align-items: center; gap: 4px; background: #f0f6fb; border: 1px solid #c5e1f5; color: #2271b1; padding: 3px 8px; border-radius: 4px; text-decoration: none; font-size: 11px; font-weight: 600; transition: 0.2s; }
.media-link-badge:hover { background: #e0f0fa; border-color: #2271b1; }

/* ==========================================
   7. FORM NHẬP LIỆU BÊN TRONG (SLIDE-OVER DRAWER)
   ========================================== */
.akira-form-card { background: #fff; border: 1px solid #ccd0d4; margin-top: 20px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; }
.akira-form-header-btn { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; cursor: pointer; background: #f0f6fb; transition: background 0.2s; border-bottom: 1px solid transparent;}
.akira-form-header-btn:hover { background: #e0f0fa; }
.akira-form-header-btn.is-open { border-bottom-color: #c5e1f5; }
#form-toggle-icon { transition: transform 0.3s ease; color: #2271b1; }
#form-toggle-icon.open { transform: rotate(180deg); }
.akira-form-wrap { display: none; padding: 20px; }
.cust-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 15px; }

.akira-wrap .dev-table { margin-bottom: 15px !important; }
.akira-wrap .dev-table thead th { padding: 12px 10px !important; border: 1px solid #ccd0d4 !important; background: #f0f0f1 !important; font-weight: bold !important; border-bottom: none !important;}
.akira-wrap .device-item td { padding: 10px !important; border: 1px solid #ddd !important; border-bottom: none !important; background: #fff !important; vertical-align: top; position: relative; } 
.akira-wrap .device-item tr.extra-row td { border-top: 1px dashed #e5e5e5 !important; border-bottom: 2px solid #2271b1 !important; padding: 15px !important; background: #f8fafd !important; }

/* Sticky footer */
.akira-form-footer {
    display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding: 15px 20px; border-top: 1px solid #eee;
    background: #fff; position: sticky; bottom: 0; z-index: 999; margin-left: -20px; margin-right: -20px; margin-bottom: -20px;
    border-radius: 0 0 6px 6px; box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}

/* Base Form Drawer */
#akira-drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 99990; display: none; backdrop-filter: blur(3px); }
#akira-tab-form { position: fixed !important; top: 0; right: -1000px; width: 950px; max-width: 100vw; height: 100vh; background: #f0f0f1; z-index: 99999; box-shadow: -5px 0 30px rgba(0,0,0,0.2); transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1); overflow-y: auto; display: block !important; padding: 0; margin: 0; }
#akira-tab-form.drawer-open { right: 0; }
#akira-tab-form .akira-form-card { margin: 0; border: none; border-radius: 0; box-shadow: none; min-height: 100vh; background: #fff;}
#akira-tab-form .akira-form-header-btn { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); padding: 15px 20px; }

/* ==========================================
   8. MODALS & PLUGINS BÊN NGOÀI & FIX LỖI POPUP
   ========================================== */
#akira-modal { background: #fff; width: 650px; max-width: 95%; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.modal-header { background: #2271b1; color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; max-height: 80vh; overflow-y: auto; }

.media-preview-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.media-preview-item { position: relative; width: 60px; height: 60px; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; background: #f0f0f1; display:flex; align-items:center; justify-content:center;}
.media-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.media-preview-item .remove-media { position: absolute; top: -5px; right: -5px; background: red; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; font-weight: bold;}

.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th, .log-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.log-table th { background: #f9f9f9; font-weight: bold; color: #555; }

.akira-insights { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-bottom: 20px; }
.insight-card { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #ccd0d4; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.insight-card h3 { margin-top: 0; font-size: 14px; color: #2271b1; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 10px; }
#akira-map { height: 300px; width: 100%; border-radius: 6px; z-index: 1; }
.chart-container { position: relative; height: 300px; width: 100%; display: flex; align-items: center; justify-content: center;}

/* Autocomplete Plugin */
.ui-autocomplete { position: absolute; z-index: 9999999 !important; background: #fff; border: 1px solid #c5e1f5; box-shadow: 0 5px 15px rgba(0,0,0,0.1); max-height: 200px; overflow-y: auto; overflow-x: hidden; padding: 0; margin: 0; list-style: none; border-radius: 0 0 6px 6px; }
.ui-menu-item-wrapper { padding: 8px 12px; font-size: 13px; color: #333; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.ui-menu-item-wrapper.ui-state-active { background: #f0f6fb !important; color: #2271b1 !important; margin: 0; border: none; }
.swal2-container { z-index: 9999999 !important; }

/* FIX LỖI POPUP/TOOLTIP SỬA NHANH BAY XUỐNG CUỐI TRANG */
.info-row, .dev-title-wrap, .dev-meta-wrap, .akira-dev-card-header, .action-buttons, .akira-input-wrapper {
    position: relative !important;
}

/* Fix dropdown danh sách gợi ý */
.akira-dropdown-list {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #c5e1f5 !important;
    z-index: 99999 !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
    border-radius: 6px !important;
}

/* MODAL TỐI THƯỢNG - ÉP TOÀN MÀN HÌNH */
#akira-modal-overlay, #akira-transfer-modal-overlay, #akira-import-modal-overlay { 
    display: none; 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important; 
    height: 100vh !important; 
    background: rgba(0,0,0,0.75) !important; 
    z-index: 999999 !important; 
    align-items: center !important; 
    justify-content: center !important; 
}

/* Ép jQuery .show() phải tuân thủ Flexbox */
#akira-modal-overlay[style*="display: block"],
#akira-transfer-modal-overlay[style*="display: block"],
#akira-import-modal-overlay[style*="display: block"] {
    display: flex !important;
}

#akira-modal { 
    background: #fff; width: 650px; max-width: 95%; border-radius: 8px; overflow: hidden; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); margin: auto !important; max-height: 90vh !important; 
    display: flex !important; flex-direction: column !important; 
}
/* ==========================================
   9. MOBILE RESPONSIVE TỔNG THỂ
   ========================================== */
@media (max-width: 782px) {
    .akira-nav-tabs { flex-direction: column; border-bottom: none; gap: 5px; }
    .akira-tab-btn { border-radius: 8px; text-align: left; }
    .akira-sticky-search { top: 46px; } 
    .akira-top-tools { flex-direction: column !important; align-items: stretch !important; gap: 10px; }
    .search-wrap { width: 100%; min-width: unset; }
    .sort-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
    .sort-wrap select { width: 100% !important; }

    /* Lưới form trên Mobile */
    .akira-wrap .dev-table thead { display: none !important; }
    .akira-wrap .dev-table { border-collapse: separate !important; border-spacing: 0 !important; }
    .akira-wrap .device-item { display: block !important; border: 2px solid #c5e1f5 !important; border-radius: 8px !important; margin-bottom: 20px !important; background: #fbfbfb !important; position: relative; padding: 15px 15px 0 !important;}
    .akira-wrap .device-item tr { display: flex !important; flex-direction: column; gap: 10px; margin-bottom: 15px; }
    .akira-wrap .device-item td { display: block !important; width: 100% !important; padding: 0 !important; border: none !important; background: transparent !important; margin-bottom: 10px; border-bottom: 1px dashed #eee !important; padding-bottom: 15px !important;}
    
    /* Card Thiết Bị trên Mobile */
    .akira-dev-grid { flex-direction: column; gap: 15px; }
    .dev-col { width: 100%; border: none; flex: none; min-width: 0;}
    .dev-col.col-actions { border-top: 1px dashed #eee; padding: 15px 0 0; flex-direction: row; justify-content: flex-end; }
    .dev-status-right { border: none; padding-right: 0; }
    .action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; }
}

/* ==========================================
   TĂNG KÍCH THƯỚC FONT CHỮ TRÊN MÀN HÌNH PC
   ========================================== */
@media (min-width: 783px) {
    /* Chữ tổng thể */
    .akira-wrap, #akira-modal-overlay, #akira-transfer-modal-overlay, #akira-import-modal-overlay { font-size: 14px; }
    
    /* Danh sách Khách hàng */
    .akira-cust-name { font-size: 18px; }
    .akira-cust-meta { font-size: 14px; }
    
    /* Thẻ Thiết bị */
    .dev-name { font-size: 17px; }
    .dev-meta-wrap { font-size: 13px; }
    .dev-col-title { font-size: 12px; margin-bottom: 12px; }
    
    /* Khối thông số chi tiết */
    .info-row { font-size: 14px; margin-bottom: 7px; }
    .info-label { font-size: 13px; width: 75px; } /* Mở rộng nhãn một chút để chữ to không bị rớt dòng */
    .port-tag { font-size: 14px; padding: 4px 6px 4px 14px; }
    .ping-result { font-size: 12px; }
    
    /* Form Input và Tabs */
    .akira-tab-btn { font-size: 16px; }
    .akira-wrap input.in-text, .akira-wrap select.in-text, .akira-wrap textarea.in-text { 
        font-size: 15px !important; 
        padding: 10px 14px !important; 
    }
}

/* ==========================================
   1. HIỆU ỨNG NHỊP TIM (PULSE RADAR) CHO MẠNG
   ========================================== */
@keyframes akiraRadarPulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 142, 62, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(30, 142, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 142, 62, 0); }
}
.ping-ok { 
    display: inline-flex; align-items: center; gap: 6px; 
    color: #1e8e3e; font-weight: bold; 
}
.ping-ok::before {
    content: ''; display: block; width: 8px; height: 8px;
    background: #1e8e3e; border-radius: 50%;
    animation: akiraRadarPulse 2s infinite;
}

/* ==========================================
   2. DÒNG THỜI GIAN (TIMELINE) BẢO TRÌ
   ========================================== */
.akira-timeline { position: relative; padding-left: 20px; margin: 15px 0; }
.akira-timeline::before {
    content: ''; position: absolute; left: 4px; top: 0; bottom: 0;
    width: 2px; background: #c5e1f5;
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
    content: ''; position: absolute; left: -21px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #2271b1; border: 3px solid #e0f0fa; box-shadow: 0 0 0 1px #fff;
}
.timeline-date { font-size: 12px; font-weight: bold; color: #2271b1; margin-bottom: 5px; }
.timeline-content { 
    background: #f8fafd; padding: 12px; border-radius: 6px; 
    border: 1px solid #e0f0fa; font-size: 13px; color: #333; line-height: 1.5;
}

/* ==========================================
   3. HỆ THỐNG NHÃN DÁN (TAGGING)
   ========================================== */
.akira-tags-wrap { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.akira-tag { 
    font-size: 10px; font-weight: bold; padding: 3px 8px; 
    border-radius: 12px; text-transform: uppercase; letter-spacing: 0.5px; 
}
.tag-vip { background: #fff4e5; color: #b06000; border: 1px solid #ffe0b2; }
.tag-project { background: #e0f0fa; color: #2271b1; border: 1px solid #c5e1f5; }
.tag-warning { background: #fce8e6; color: #d63638; border: 1px solid #f5c2c7; }

/* ==========================================
   4. MINIMAP TRONG THẺ KHÁCH HÀNG
   ========================================== */
.cust-minimap { 
    width: 100%; height: 100px; border-radius: 6px; 
    border: 1px solid #ddd; margin-top: 15px; 
    background: #f0f0f1; z-index: 1; pointer-events: none; /* Khóa chuột để cuộn trang không bị vướng map */
}

/* ==========================================
   5. KÉO THẢ (DRAG & DROP)
   ========================================== */
.akira-sortable-list { min-height: 50px; }
.ui-sortable-helper { 
    box-shadow: 0 15px 30px rgba(0,0,0,0.2) !important; 
    transform: scale(1.02); z-index: 9999; cursor: grabbing !important;
}
.ui-sortable-placeholder { 
    border: 2px dashed #c5e1f5 !important; background: #f0f6fb !important; 
    visibility: visible !important; border-radius: 8px; margin-bottom: 12px;
}
.drag-handle { cursor: grab; color: #ccc; margin-right: 10px; font-size: 20px; transition: 0.2s;}
.drag-handle:hover { color: #2271b1; }
.akira-dev-card-header:active .drag-handle { cursor: grabbing; }

/* Hiệu ứng kéo giãn mượt mà cho Bản đồ */
.cust-minimap {
    transition: height 0.3s ease-in-out !important;
}

/* Ép nhận chiều cao mới khi rê chuột vào */
.cust-minimap:hover {
    height: 450px !important; /* Mình khuyên dùng 450px để không bị lố quá màn hình laptop */
}

/* ==========================================
   TỐI ƯU GIAO DIỆN COMPACT GRID CHO DEVICE LIST
   ========================================== */
.akira-dev-card { margin-bottom: 8px !important; border: 1px solid #e0e0e0 !important; border-radius: 6px !important; background: #fff !important; overflow: visible !important; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.akira-dev-card-header { padding: 8px 12px !important; display: flex !important; align-items: center !important; gap: 10px !important; transition: background 0.2s; }
.akira-dev-card-header:hover { background: #fcfcfc !important; }
.akira-dev-card-body { padding: 12px !important; background: #fafbfc !important; border-top: 1px solid #eee !important; }
.akira-dev-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; gap: 15px !important; }
.dev-col { background: #fff; padding: 10px 12px; border-radius: 6px; border: 1px solid #f0f0f1; box-shadow: 0 1px 2px rgba(0,0,0,0.02); display: flex; flex-direction: column; }
.dev-col-title { font-size: 11px !important; font-weight: bold !important; color: #888 !important; text-transform: uppercase !important; margin-bottom: 8px !important; border-bottom: 1px solid #eee !important; padding-bottom: 4px !important; }
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; border-bottom: 1px dashed #f5f5f5; padding-bottom: 4px; line-height: 1.4; }
.info-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.info-label { color: #888; flex-shrink: 0; margin-right: 5px; }
.info-val { display: flex; align-items: center; gap: 4px; text-align: right; justify-content: flex-end; flex-wrap: wrap; word-break: break-word; color: #333; }
.dev-thumbnail { width: 36px; height: 36px; flex-shrink: 0; }
.dev-meta-wrap { font-size: 11px; color: #777; display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }

/* CSS MENU THAO TÁC DROPDOWN (BÁNH RĂNG) */
.dev-dropdown { position: relative; display: inline-block; padding: 0 5px; }
.dev-dropdown-btn { background: none; border: 1px solid transparent; padding: 4px; cursor: pointer; color: #888; border-radius: 4px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.dev-dropdown-btn:hover, .dev-dropdown:hover .dev-dropdown-btn { background: #f0f0f1; border-color: #ddd; color: #2271b1; }
.dev-dropdown-content { display: none; position: absolute; right: 0; top: 100%; background-color: #fff; min-width: 170px; box-shadow: 0px 5px 15px rgba(0,0,0,0.15); z-index: 999; border-radius: 6px; border: 1px solid #ddd; padding: 6px 0; overflow: hidden; }
.dev-dropdown:hover .dev-dropdown-content { display: block; }
.dev-dropdown-content button { color: #444; padding: 10px 15px; text-decoration: none; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none; cursor: pointer; font-size: 13px; transition: 0.2s; white-space: nowrap; }
.dev-dropdown-content button:hover { background-color: #f0f6fb; color: #2271b1; }
.dev-dropdown-content button.delete-btn:hover { background-color: #fce8e6; color: #d63638; }
.dev-dropdown-content .dashicons { font-size: 16px; width: 16px; height: 16px; opacity: 0.7; }

/* ==========================================
   FORM NHẬP LIỆU THIẾT BỊ 2.0 (ACCORDION & GRID)
   ========================================== */
.akira-global-settings { background: #e0f0fa; border: 1px solid #c5e1f5; border-radius: 6px; padding: 15px; margin-bottom: 20px; }
.ags-title { font-weight: bold; color: #2271b1; margin-bottom: 10px; font-size: 13px; text-transform: uppercase; }
.ags-fields { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end;}
.ags-fields > div { flex: 1; min-width: 150px; }
.ags-fields label { display: block; font-size: 12px; color: #555; margin-bottom: 5px; font-weight: bold; }

.dev-form-card { background: #fff; border: 1px solid #ccd0d4; border-radius: 6px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.dev-form-card-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: #fbfbfb; border-bottom: 1px solid transparent; cursor: pointer; border-radius: 6px 6px 0 0; transition: 0.2s;}
.dev-form-card-header:hover { background: #f0f6fb; }
.dev-form-title { font-weight: bold; color: #2271b1; font-size: 14px; display: flex; align-items: center; }
.dev-form-actions { display: flex; gap: 8px; align-items: center; }
.btn-clone-dev { background: #e6f4ea; color: #1e8e3e; border: 1px solid #cce8d6; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; transition:0.2s;}
.btn-clone-dev:hover { background: #d3ead8; border-color: #1e8e3e;}
.btn-remove-dev { background: #fce8e6; color: #d63638; border: 1px solid #f5c2c7; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; transition:0.2s;}
.btn-remove-dev:hover { background: #f8d7da; border-color: #d63638;}

.dev-form-body { padding: 15px; border-top: 1px solid #eee; display: none; } /* Mặc định gập */
.dev-form-section { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed #eee; }
.dev-form-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.dfs-title { font-size: 11px; color: #888; text-transform: uppercase; font-weight: bold; margin-bottom: 10px; }

.dfs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 15px; }
.dfs-col label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 600; }
.dfs-col input, .dfs-col select { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; box-sizing: border-box; transition: 0.2s;}
.dfs-col input:focus, .dfs-col select:focus { border-color: #2271b1; outline: none; box-shadow: 0 0 0 1px #2271b1; }