/* IT Asset Table Styles */
.k-plus-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    padding: 1.5rem;
}

/* Filters */
.k-plus-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.k-plus-input,
.k-plus-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.k-plus-input:focus,
.k-plus-select:focus {
    border-color: #00A950;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 169, 80, 0.1);
}

/* Table */
.k-plus-table-wrapper {
    overflow-x: auto;
}

.k-plus-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
}

.k-plus-table th,
.k-plus-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
    font-size: 0.95rem;
}

.k-plus-table th {
    background: #F8FAFC;
    font-weight: 600;
    color: #1A202C;
    white-space: nowrap;
}

.k-plus-table tbody tr:hover {
    background: #F7FFF9;
}

.k-plus-table .no-items {
    text-align: center;
    color: #718096;
    padding: 2rem;
}

/* Table Footer */
.k-plus-table-footer td {
    background: #F8FAFC;
    color: #718096;
    font-size: 0.9rem;
}

/* Edit Button */
.k-plus-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #00A950;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.k-plus-button:hover {
    background: #008940;
}

.k-plus-button:active {
    transform: scale(0.98);
}

/* Edit Mode */
.k-plus-table td input,
.k-plus-table td select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #00A950;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Pagination */
.k-plus-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

.k-plus-page-numbers {
    display: flex;
    gap: 0.25rem;
}

.k-plus-page-number,
.k-plus-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    background: white;
    color: #2D3748;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.k-plus-page-number:hover,
.k-plus-page-btn:hover {
    background: #F7FFF9;
    border-color: #00A950;
    color: #00A950;
}

.k-plus-page-number.current {
    background: #00A950;
    border-color: #00A950;
    color: white;
}

.k-plus-page-btn.prev,
.k-plus-page-btn.next {
    padding: 0 1rem;
}

/* Loading State */
.k-plus-button.loading {
    position: relative;
    color: transparent;
}

.k-plus-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: button-loading 0.8s linear infinite;
}

@keyframes button-loading {
    to {
        transform: rotate(360deg);
    }
}

/* Notification */
.k-plus-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 2rem;
    border-radius: 4px;
    color: white;
    font-size: 0.95rem;
    z-index: 1000;
    animation: slide-in 0.2s ease;
}

.k-plus-notification.success {
    background: #00A950;
}

.k-plus-notification.error {
    background: #E53E3E;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .k-plus-table-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .filter-group {
        flex: 100%;
    }
    
    .k-plus-table th,
    .k-plus-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .k-plus-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .k-plus-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .k-plus-page-number,
    .k-plus-page-btn {
        min-width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .k-plus-filters,
    .k-plus-button,
    .k-plus-pagination {
        display: none;
    }
    
    .k-plus-table-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .k-plus-table th,
    .k-plus-table td {
        border: 1px solid #000;
    }
}

.asset-code-link {
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    display: block;
    transition: color 0.2s;
}

.asset-code-link:hover {
    color: #00a0d2;
    text-decoration: underline;
}

/* เพิ่ม CSS สำหรับการแจ้งเตือน */
.k-plus-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.k-plus-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.k-plus-notification.error {
    background-color: #f44336;
}

/* เพิ่มสไตล์สำหรับดรอปดาวน์ที่มีจำนวน */
.k-plus-select {
    font-size: 14px;
    padding: 6px 30px 6px 10px;
    border-radius: 4px;
    min-width: 180px;
}

/* สไตล์สำหรับตัวเลือก "ทั้งหมด" ที่มีตัวเลขจำนวนรวม */
.k-plus-select option:first-child {
    font-weight: bold;
    color: #333;
}

/* สไตล์สำหรับตัวเลือกอื่นๆ ที่มีตัวเลขจำนวน */
.k-plus-select option {
    padding: 5px;
}

/* สไตล์สำหรับจำนวนในวงเล็บ */
.count-number {
    color: #666;
    font-size: 0.9em;
}

/* CSS สำหรับ loading indicator */
.k-plus-loading {
    display: none;
    text-align: center;
    padding: 20px;
    width: 100%;
}
.k-plus-loading.active {
    display: block;
}
.k-plus-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    margin-bottom: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CSS สำหรับลิงก์รหัสทรัพย์สิน */
.asset-code-link {
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    display: block;
    transition: color 0.2s;
}
.asset-code-link:hover {
    color: #00a0d2;
    text-decoration: underline;
}

/* CSS สำหรับการแจ้งเตือน */
.k-plus-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}
.k-plus-notification.show {
    transform: translateY(0);
    opacity: 1;
}
.k-plus-notification.error {
    background-color: #f44336;
}

/* CSS สำหรับดรอปดาวน์ที่มีจำนวน */
.k-plus-select {
    font-size: 14px;
    padding: 6px 30px 6px 10px;
    border-radius: 4px;
    min-width: 180px;
}
.k-plus-select option:first-child {
    font-weight: bold;
    color: #333;
}
.k-plus-select option {
    padding: 5px;
}