.attachments-grid, .attachments-grid-input {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.attachment-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.attach-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer;
    display: none;
}

.attachment-box:hover .attach-delete-btn {
    display: block;
}

.attach-delete-btn:hover {
    background: #dc3545;
}

.attachment-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.attachment-box img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    border-radius: 4px;
}

.file-icon {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
    color: #fff;
    font-size: 18px;
}

/* ألوان حسب نوع الملف */
.file-icon.pdf { background: #e63946; }
.file-icon.doc,
.file-icon.docx { background: #2a6fdb; }
.file-icon.xls,
.file-icon.xlsx { background: #2b9348; }
.file-icon.ppt,
.file-icon.pptx { background: #f77f00; }
.file-icon.zip,
.file-icon.rar { background: #6c757d; }

.file-name {
    margin-top: 6px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.temp-badge {
    position: absolute;
    top: 4px;
    right: 35%;
    font-size: 10px;
    background: #0d6efd;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

.remove-row {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dc3545;
    background-color: transparent;
    color: #dc3545;
    font-size: 18px;
    line-height: 1;
    transition: 0.2s ease;
    padding: 0;
}

.remove-row:hover {
    background-color: #dc3545;
    color: #fff;
    transform: scale(1.05);
}

input[type="file"]::file-selector-button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background-color: #1d4ed8;
}
